:root {
    color-scheme: light;
    font-family: "Segoe UI", Arial, sans-serif;
    --primary: #1f4e79;
    --primary-dark: #163a5a;
    --accent: #3f7fbf;
    --light: #f5f7fa;
    --border: #d7dde5;
    --text: #1a1a1a;
    --muted: #5a6776;
    --card-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

body {
    margin: 0;
    background: linear-gradient(180deg, #eef3f8 0%, #f8fafc 100%);
    color: var(--text);
}

.app-header {
    background: linear-gradient(135deg, var(--primary) 0%, #295f94 100%);
    color: #fff;
    padding: 18px 0;
    position: sticky;
    top: 0;
    z-index: 20;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.15);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.16);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.brand-mark svg {
    width: 24px;
    height: 24px;
    fill: #fff;
}

.brand-title {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.brand-subtitle {
    font-size: 0.85rem;
    opacity: 0.8;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: rgba(255, 255, 255, 0.18);
    border: none;
    padding: 8px 10px;
    border-radius: 10px;
    cursor: pointer;
}

.nav-toggle__bar {
    width: 24px;
    height: 2px;
    background: #fff;
    border-radius: 999px;
}

.main-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
}

.main-nav a {
    color: #fff;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.12);
    transition: background 0.2s ease, transform 0.2s ease;
}

.main-nav a:hover {
    background: rgba(255, 255, 255, 0.22);
    transform: translateY(-1px);
}

.nav-icon {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: #fff;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.container {
    width: min(1200px, 92%);
    margin: 0 auto;
}

main {
    padding: 28px 0 56px;
}

.card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 22px;
    box-shadow: var(--card-shadow);
}

.card h2 {
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.card-header h2 {
    margin: 0;
}

.card-header .actions {
    margin: 0;
}

.card h2 .icon {
    font-size: 1.1rem;
    display: inline-flex;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(31, 78, 121, 0.12);
    color: var(--primary);
}

form .grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px 20px;
}

form .grid > div {
    display: flex;
    flex-direction: column;
}

.field-row {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 6px;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--muted);
}

.icon {
    margin-right: 6px;
}

input, select, textarea {
    width: 100%;
    padding: 8px;
    border-radius: 10px;
    border: 1px solid var(--border);
    font-size: 0.95rem;
    background: #fff;
    transition: border 0.2s ease, box-shadow 0.2s ease;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(63, 127, 191, 0.2);
}

textarea {
    resize: vertical;
    min-height: 80px;
}

button {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 10px 16px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(31, 78, 121, 0.2);
}

button.secondary {
    background: #3f6fa0;
}

a.secondary {
    background: #3f6fa0;
    color: #fff;
    padding: 10px 16px;
    border-radius: 10px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.actions a,
.actions button,
a.secondary {
    text-decoration: none;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    font-size: 0.95rem;
}

.table th, .table td {
    border: 1px solid var(--border);
    padding: 8px;
    text-align: left;
}

.table th {
    background: #f4f7fb;
    color: var(--muted);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.6px;
}

.table tbody tr:nth-child(even) {
    background: #fafbfc;
}

.tag {
    display: inline-block;
    background: #eef3f8;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.85rem;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.85rem;
    background: rgba(31, 78, 121, 0.12);
    color: var(--primary-dark);
    font-weight: 600;
}

.alert {
    padding: 10px 12px;
    border-radius: 6px;
    background: #e3f1ff;
    border: 1px solid #a9c9ed;
    margin-bottom: 12px;
}

footer {
    padding: 16px 0;
    background: #fff;
    border-top: 1px solid var(--border);
    color: #555;
}

.actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.actions a {
    background: var(--primary);
    color: #fff;
    padding: 10px 16px;
    border-radius: 10px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.actions a:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(31, 78, 121, 0.2);
}

.actions a.secondary {
    background: #3f6fa0;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.detail-card {
    background: #f8fbff;
    border: 1px solid #d8e4f2;
    border-radius: 14px;
    padding: 14px;
}

.detail-card strong {
    color: var(--muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.detail-value {
    font-size: 1.05rem;
    font-weight: 600;
    margin-top: 6px;
}

.qr-card {
    display: flex;
    align-items: center;
    gap: 18px;
    background: #f8fbff;
    border: 1px solid #d8e4f2;
    border-radius: 16px;
    padding: 16px;
}

.qr-card img {
    width: 120px;
    height: 120px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #fff;
    padding: 8px;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 50;
}

.modal.is-open {
    display: flex;
}

.modal__content {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    width: min(640px, 95%);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.modal__header h3 {
    margin: 0;
}

.modal-form .actions {
    margin-top: 12px;
}

.license-logo {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    object-fit: contain;
    background: #f2f4f7;
    border: 1px solid var(--border);
}

.license-logo.placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

.license-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

small {
    color: #555;
}

.list-clean {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 8px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

@media (max-width: 900px) {
    .nav-toggle {
        display: inline-flex;
    }

    .main-nav {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        margin-top: 12px;
    }

    .main-nav.is-open {
        display: flex;
    }

    .main-nav a {
        justify-content: flex-start;
    }
}
