﻿:root {
    --primary: #1a5276;
    --primary-light: #2980b9;
    --accent: #e74c3c;
    --bg: #f0f2f5;
    --card: #ffffff;
    --text: #2c3e50;
    --text-light: #7f8c8d;
    --border: #dce1e6;
    --success: #27ae60;
    --warning: #f39c12;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

/* ===== HEADER ===== */
.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: 20px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    position: sticky;
    top: 0;
    z-index: 100;
}

    .header h1 {
        font-size: 1.3em;
        font-weight: 600;
    }

    .header .subtitle {
        font-size: 0.8em;
        opacity: 0.85;
        margin-top: 2px;
    }

.header-actions {
    display: flex;
    gap: 10px;
}

.field-validation-error, .validation-summary-errors {
    color: red;
}

.validation-summary-errors {
    padding-left: 20px;
}

.form-card.form-autorize {
    width: 500px;
    max-height: 370px;
    display: inline-table;
}

.form-container
{
    display: flex;
    height: 100vh;
    align-items: center;
    justify-content: center;
}

.btn {
    padding: 8px 18px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

    .btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    }

    .btn:active {
        transform: translateY(0);
    }

.btn-primary {
    background: var(--primary-light);
    color: white;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-accent {
    background: var(--accent);
    color: white;
}

.btn-outline {
    background: transparent;
    color: white;
    border: 1.5px solid rgba(255,255,255,0.6);
}

    .btn-outline:hover {
        background: rgba(255,255,255,0.15);
    }

/* ===== LAYOUT ===== */
.layout {
    display: flex;
    min-height: calc(100vh - 80px);
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: 280px;
    background: var(--card);
    border-right: 1px solid var(--border);
    padding: 20px 0;
    flex-shrink: 0;
}

.sidebar-section {
    padding: 0 20px;
    margin-bottom: 15px;
}

    .sidebar-section h3 {
        font-size: 0.7em;
        text-transform: uppercase;
        letter-spacing: 1px;
        color: var(--text-light);
        margin-bottom: 8px;
    }

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    cursor: pointer;
    transition: all 0.15s;
    border-left: 3px solid transparent;
    font-size: 0.9em;
}

    .nav-item:hover {
        background: #f7f9fc;
    }

    .nav-item.active {
        background: #eaf2fb;
        border-left-color: var(--primary-light);
        color: var(--primary);
        font-weight: 600;
    }

    .nav-item .nav-icon {
        width: 32px;
        height: 32px;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.1em;
        flex-shrink: 0;
    }

    .nav-item:nth-child(1) .nav-icon {
        background: #eaf2fb;
    }

    .nav-item:nth-child(2) .nav-icon {
        background: #fef3e2;
    }

    .nav-item:nth-child(3) .nav-icon {
        background: #e8f8ef;
    }

    .nav-item:nth-child(4) .nav-icon {
        background: #fde8e8;
    }

    .nav-item:nth-child(5) .nav-icon {
        background: #f0e6ff;
    }

/* ===== MAIN CONTENT ===== */
.main {
    flex: 1;
    padding: 25px 30px;
    overflow-y: auto;
    max-height: calc(100vh - 80px);
}

.tab-content {
    display: none;
}

    .tab-content.active {
        display: block;
    }

/* ===== FORMS ===== */
.form-card {
    background: var(--card);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

    .form-card h2 {
        font-size: 1.15em;
        margin-bottom: 20px;
        padding-bottom: 10px;
        border-bottom: 2px solid var(--bg);
        color: var(--primary);
    }

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

    .form-grid .full-width {
        grid-column: 1 / -1;
    }

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

    .form-group label {
        font-size: 0.82em;
        font-weight: 600;
        color: var(--text);
    }

        .form-group label .req {
            color: var(--accent);
        }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 9px 12px;
        border: 1.5px solid var(--border);
        border-radius: 6px;
        font-size: 0.9em;
        transition: border-color 0.2s;
        font-family: inherit;
    }

        .form-group input:focus,
        .form-group select:focus,
        .form-group textarea:focus {
            outline: none;
            border-color: var(--primary-light);
            box-shadow: 0 0 0 3px rgba(41,128,185,0.1);
        }

    .form-group textarea {
        resize: vertical;
        min-height: 80px;
    }

    .form-group .hint {
        font-size: 0.75em;
        color: var(--text-light);
    }

/* ===== DOCUMENT PREVIEW ===== */
.doc-preview {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 50px 60px;
    max-width: 210mm;
    margin: 0 auto;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    font-family: 'Times New Roman', Times, serif;
    font-size: 14px;
    line-height: 1.6;
}

    .doc-preview h1 {
        text-align: center;
        font-size: 16px;
        font-weight: 700;
        margin: 20px 0 10px;
        font-family: 'Times New Roman', serif;
    }

    .doc-preview h2 {
        text-align: center;
        font-size: 15px;
        font-weight: 700;
        margin: 18px 0 8px;
        font-family: 'Times New Roman', serif;
    }

    .doc-preview h3 {
        font-size: 14px;
        font-weight: 700;
        margin: 15px 0 6px;
        font-family: 'Times New Roman', serif;
    }

    .doc-preview p {
        text-align: justify;
        text-indent: 1.25cm;
        margin-bottom: 6px;
    }

    .doc-preview .no-indent {
        text-indent: 0;
    }

    .doc-preview .center {
        text-align: center;
        text-indent: 0;
    }

    .doc-preview .right {
        text-align: right;
        text-indent: 0;
    }

    .doc-preview ul, .doc-preview ol {
        margin-left: 1.25cm;
        margin-bottom: 6px;
    }

    .doc-preview li {
        margin-bottom: 3px;
    }

    .doc-preview .stamp {
        display: flex;
        justify-content: space-between;
        margin-top: 30px;
    }

    .doc-preview .stamp-item {
        width: 45%;
    }

    .doc-preview table {
        width: 100%;
        border-collapse: collapse;
        margin: 10px 0;
        font-size: 13px;
    }

        .doc-preview table th,
        .doc-preview table td {
            border: 1px solid #333;
            padding: 6px 8px;
            text-align: center;
        }

        .doc-preview table th {
            background: #f5f5f5;
            font-weight: 700;
        }

    .doc-preview .doc-header-block {
        display: flex;
        justify-content: space-between;
        margin-bottom: 20px;
    }

        .doc-preview .doc-header-block .approve-block {
            width: 45%;
            text-align: right;
        }

        .doc-preview .doc-header-block .title-block {
            width: 50%;
            text-align: center;
        }

    .doc-preview .signature-block {
        margin-top: 40px;
    }

    .doc-preview .signature-line {
        border-bottom: 1px solid #333;
        display: inline-block;
        min-width: 200px;
        margin: 0 5px;
    }

/* ===== GENERATE BUTTON AREA ===== */
.generate-area {
    text-align: center;
    margin: 20px 0;
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== TABS INSIDE FORM ===== */
.sub-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--bg);
    padding-bottom: 0;
}

.sub-tab {
    padding: 8px 16px;
    cursor: pointer;
    border-radius: 6px 6px 0 0;
    font-size: 0.85em;
    font-weight: 500;
    transition: all 0.15s;
    border: 1px solid transparent;
    border-bottom: none;
    background: transparent;
}

    .sub-tab:hover {
        background: #f0f2f5;
    }

    .sub-tab.active {
        background: white;
        border-color: var(--border);
        color: var(--primary);
        font-weight: 600;
        margin-bottom: -2px;
        border-bottom-color: white;
    }

.sub-content {
    display: none;
}

    .sub-content.active {
        display: block;
    }

/* ===== CHECKBOX ===== */
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

    .checkbox-group label {
        display: flex;
        align-items: center;
        gap: 5px;
        font-weight: 400;
        font-size: 0.88em;
        cursor: pointer;
    }

/* ===== PRINT ===== */
@media print {
    body {
        background: white;
    }

    .header, .sidebar, .generate-area, .form-card, .no-print {
        display: none !important;
    }

    .layout {
        display: block;
    }

    .main {
        padding: 0;
        max-height: none;
    }

    .doc-preview {
        box-shadow: none;
        border: none;
        padding: 20mm 15mm 20mm 30mm;
        max-width: none;
    }

    .tab-content {
        display: block !important;
        page-break-after: always;
    }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
        display: flex;
        overflow-x: auto;
        padding: 10px;
        gap: 5px;
    }

    .sidebar-section {
        display: none;
    }

    .nav-item {
        border-left: none;
        border-bottom: 3px solid transparent;
        padding: 8px 12px;
        white-space: nowrap;
        font-size: 0.82em;
    }

        .nav-item.active {
            border-left: none;
            border-bottom-color: var(--primary-light);
        }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .doc-preview {
        padding: 25px 20px;
    }

    .main {
        max-height: none;
    }
}

/* ===== STATUS BAR ===== */
.status-bar {
    background: var(--card);
    border-top: 1px solid var(--border);
    padding: 8px 20px;
    font-size: 0.78em;
    color: var(--text-light);
    display: flex;
    justify-content: space-between;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
}

.progress-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}

.progress-bar {
    width: 120px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--success);
    transition: width 0.3s;
    border-radius: 2px;
}

/* ===== TOOLTIP ===== */
.tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
}

    .tooltip .tooltip-text {
        visibility: hidden;
        background: #333;
        color: white;
        padding: 6px 10px;
        border-radius: 4px;
        font-size: 0.78em;
        position: absolute;
        z-index: 200;
        bottom: 125%;
        left: 50%;
        transform: translateX(-50%);
        white-space: nowrap;
        opacity: 0;
        transition: opacity 0.2s;
    }

    .tooltip:hover .tooltip-text {
        visibility: visible;
        opacity: 1;
    }

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7em;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-new {
    background: #e8f8ef;
    color: var(--success);
}

.badge-required {
    background: #fde8e8;
    color: var(--accent);
}

/* ===== CHECKLIST ===== */
.checklist {
    list-style: none;
    padding: 0;
}

    .checklist li {
        padding: 6px 0;
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 0.88em;
    }

        .checklist li input[type="checkbox"] {
            accent-color: var(--primary-light);
            width: 16px;
            height: 16px;
        }

        .checklist li.done {
            text-decoration: line-through;
            color: var(--text-light);
        }
