:root {
    --bg-dark: #0f172a;
    /* Slate 900 */
    --bg-card: #1e293b;
    /* Slate 800 */
    --bg-input: #0f172a;
    --text-primary: #f8fafc;
    /* Slate 50 */
    --text-secondary: #94a3b8;
    /* Slate 400 */
    --border-color: #334155;
    /* Slate 700 */
    --border-light: #475569;
    --accent: #3b82f6;
    /* Blue 500 */
    --accent-hover: #2563eb;
    /* Blue 600 */
    --danger: #ef4444;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.2s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* App Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Navigation */
.nav-bar {
    width: 250px;
    background-color: var(--bg-card);
    border-right: 1px solid var(--border-color);
    padding: 24px 0;
    flex-shrink: 0;
    position: fixed;
    height: 100vh;
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 24px 32px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent);
}

.nav-links {
    list-style: none;
}

.nav-links li {
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--text-secondary);
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
}

.nav-links li:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.03);
}

.nav-links li.active {
    color: var(--accent);
    background-color: rgba(59, 130, 246, 0.1);
    border-right: 3px solid var(--accent);
}

.nav-links li i {
    width: 20px;
    height: 20px;
}

/* Main Content Area */
.content-area {
    flex-grow: 1;
    margin-left: 250px;
    padding: 40px;
    max-width: 1400px;
}

.header {
    margin-bottom: 32px;
}

.header h2 {
    font-size: 1.75rem;
    margin-bottom: 8px;
    font-weight: 700;
}

.header p {
    color: var(--text-secondary);
}

/* Tab Switching */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Cards & Forms */
.card {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 24px;
}

.form-card h3 {
    margin-bottom: 20px;
    font-size: 1.125rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label,
.ip-group-wrap label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-row .half {
    flex: 1;
}

input[type="text"],
input[type="tel"],
input[type="date"],
select,
textarea {
    width: 100%;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-family: inherit;
    transition: var(--transition);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

select option {
    background-color: var(--bg-card);
    color: var(--text-primary);
}

textarea {
    resize: vertical;
}

.info-box {
    background: rgba(59, 130, 246, 0.05);
    border: 1px solid rgba(59, 130, 246, 0.2);
    padding: 16px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.info-box strong {
    color: var(--text-primary);
}

.hidden {
    display: none !important;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--accent);
    color: white;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
}

.btn-danger {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.btn-danger:hover {
    background-color: rgba(239, 68, 68, 0.2);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 6px;
}

.btn-text {
    background: transparent;
    color: var(--accent);
    padding: 0;
}

.btn-text:hover {
    text-decoration: underline;
}

.btn-icon,
.btn-remove {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-icon:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1.05rem;
}

.form-actions {
    display: flex;
    gap: 12px;
}

.mt-6 {
    margin-top: 24px;
}

/* Grid Forms (Work Register) */
.grid-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}

/* Dynamic Rows */
.dynamic-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    align-items: center;
}

.dynamic-row input {
    flex: 1;
}

.ip-group-wrap {
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.02);
    padding: 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.ip-inputs {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ip-input-row {
    display: flex;
    gap: 8px;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th {
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 16px;
    border-bottom: 1px solid rgba(51, 65, 85, 0.5);
    color: var(--text-primary);
}

.data-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .grid-form {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }

    .nav-bar {
        position: relative;
        width: 100%;
        height: auto;
        padding: 16px;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .logo {
        padding: 0 0 16px 0;
    }

    .nav-links {
        display: flex;
        width: 100%;
        overflow-x: auto;
        gap: 8px;
    }

    .nav-links li {
        padding: 12px 16px;
        white-space: nowrap;
        border-right: none;
        border-bottom: 3px solid transparent;
        border-radius: var(--radius-md);
    }

    .nav-links li.active {
        border-bottom: 3px solid var(--accent);
        border-right: none;
    }

    .content-area {
        margin-left: 0;
        padding: 20px;
    }

    .dynamic-row {
        flex-wrap: wrap;
    }

    .dynamic-row input {
        width: 100%;
        min-width: 100%;
    }
}

/* PDF Print Styles (Hidden initially) */
#pdf-report-container {
    background: white;
    color: black;
    width: 210mm;
    /* A4 width */
    font-family: 'Pretendard', sans-serif;
}

.pdf-wrapper {
    padding: 40px;
    background-color: white;
    color: #111;
}

.pdf-header {
    text-align: center;
    margin-bottom: 40px;
    border-bottom: 2px solid #222;
    padding-bottom: 20px;
}

.pdf-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
    color: #000;
}

.pdf-meta {
    font-size: 14px;
    color: #555;
    text-align: right;
}

.pdf-section {
    margin-bottom: 30px;
}

.pdf-section-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #111;
    border-left: 4px solid var(--accent);
    padding-left: 10px;
}

.pdf-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    color: #222;
}

.pdf-table th,
.pdf-table td {
    border: 1px solid #ccc;
    padding: 10px 12px;
    text-align: left;
    color: #222;
}

.pdf-table th {
    background-color: #f3f4f6;
    font-weight: 600;
    color: #111;
}

.pdf-table-striped tbody tr:nth-child(even) {
    background-color: #fafafa;
}

.pdf-notes-box {
    border: 1px solid #ccc;
    padding: 15px;
    min-height: 100px;
    font-size: 14px;
    white-space: pre-wrap;
    color: #222;
}

.pdf-footer {
    margin-top: 50px;
    text-align: center;
    font-size: 14px;
    color: #555;
}

.pdf-signatures {
    display: flex;
    justify-content: flex-end;
    gap: 40px;
    margin-top: 30px;
}

.pdf-signatures div {
    border-top: 1px solid #000;
    padding-top: 10px;
    width: 150px;
    text-align: center;
}