:root {
    --primary-dark: #0f172a;
    --primary: #1a1f5e;
    --primary-light: #3b45c4;
    --primary-lighter: #6366f1;
    --accent: #06b6d4;
    --accent-light: #22d3ee;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --bg-gradient: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 50%, #e5e7eb 100%);
    --card-shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
    --card-shadow-lg: 0 20px 40px rgba(15, 23, 42, 0.12);
    --radius: 12px;
    --radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", sans-serif;
    background: #fbfcff;
    color: var(--primary-dark);
    line-height: 1.6;
    min-height: 100vh;
    padding: 32px 20px;
    padding-top: 120px;
}

/* ── NAVBAR ADMIN ── */
.admin-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 28px;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid #e4e6f0;
    box-shadow: 0 8px 28px rgba(26, 31, 94, 0.04);
    height: 72px;
    gap: 24px;
}

.admin-navbar-left {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
}

.admin-navbar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #1a1f5e;
    white-space: nowrap;
}

.admin-navbar-logo img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.admin-navbar-logo span {
    font-size: 14px;
    font-weight: 700;
    color: #1a1f5e;
}

.admin-navbar-center {
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: center;
    min-width: 0;
}

.admin-nav-menu {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.admin-nav-link {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
    color: #666666;
    text-decoration: none;
    border-radius: 6px;
    transition: var(--transition);
    white-space: nowrap;
}

.admin-nav-link:hover {
    color: #1a1f5e;
    background: rgba(26, 31, 94, 0.04);
}

.admin-nav-link.active {
    color: #1a1f5e;
    background: rgba(240, 165, 0, 0.1);
    font-weight: 700;
    border-bottom: 2px solid rgba(240, 165, 0, 0.55);
}

.admin-navbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.admin-navbar a {
    text-decoration: none;
    color: #1a1f5e;
    font-size: 13px;
    font-weight: 500;
}

.navbar-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    background: var(--gray-100);
    color: var(--primary-dark);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
    white-space: nowrap;
    font-family: inherit;
}

.navbar-logout:hover {
    background: var(--gray-200);
    border-color: var(--gray-300);
}

.navbar-logout:active {
    transform: scale(0.98);
}

@media (max-width: 900px) {
    .admin-nav-link {
        padding: 6px 10px;
        font-size: 11px;
    }
    
    .admin-nav-menu {
        gap: 2px;
    }
}

@media (max-width: 768px) {
    .admin-navbar {
        padding: 8px 12px;
        height: 64px;
        gap: 12px;
    }
    
    .admin-navbar-center {
        display: none;
    }
    
    .admin-navbar-left {
        gap: 16px;
    }
    
    .admin-navbar-logo span {
        display: none;
    }

    .admin-navbar-title {
        font-size: 14px;
    }

    .navbar-logout {
        padding: 6px 12px;
        font-size: 12px;
    }
}

main {
    max-width: 1200px;
    margin: 0 auto;
}

.admin-shell,
.shell,
.container {
    width: 100% !important;
    max-width: 1200px !important;
    margin: 0 auto !important;
}

.login-shell {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 64px);
}

.panel,
.login-container {
    background: white;
    border-radius: var(--radius-lg);
    padding: 40px;
    max-width: 460px;
    width: 100%;
    box-shadow: var(--card-shadow-lg);
    border: 1px solid rgba(59, 69, 196, 0.08);
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.98);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

header {
    background: white;
    border-radius: var(--radius-lg);
    padding: 32px;
    margin-bottom: 32px;
    box-shadow: var(--card-shadow-lg);
    border: 1px solid rgba(59, 69, 196, 0.08);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

header > div:first-child {
    flex: 1;
}

header h1 {
    font-size: clamp(28px, 5vw, 40px);
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

header p {
    color: var(--gray-500);
    font-size: 15px;
    line-height: 1.6;
}

h1 {
    font-size: 40px;
    font-weight: 800;
    color: var(--primary-dark);
    letter-spacing: -0.5px;
}

h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 12px;
    letter-spacing: -0.3px;
}

h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-dark);
}

p {
    color: var(--gray-500);
    font-size: 15px;
    line-height: 1.7;
}

label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 8px;
    text-transform: none;
}

.section-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gray-500);
    margin: 40px 0 24px 0;
}

.form-group {
    margin-bottom: 20px;
}

input:not([type]),
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="tel"],
textarea,
select {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #e4e6f0;
    border-radius: var(--radius);
    font-size: 14px;
    font-family: 'Manrope', inherit;
    color: #1a1f5e;
    background: #ffffff;
    transition: var(--transition);
}

select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a1f5e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 40px;
}

input:not([type]):focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="tel"]:focus,
textarea:focus,
select:focus {
    outline: 3px solid rgba(240, 165, 0, 0.55);
    outline-offset: 3px;
    border-color: #e4e6f0;
    background: #ffffff;
}

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

input[type="checkbox"],
input[type="radio"] {
    cursor: pointer;
    margin-right: 8px;
}

button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: var(--radius);
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
    white-space: nowrap;
    text-transform: none;
}

button:active,
.button:active {
    transform: scale(0.98);
}

button:disabled,
.button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

button,
.button {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 69, 196, 0.3);
}

button:hover,
.button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 69, 196, 0.4);
}

.button.secondary,
.logout-btn,
.back {
    background: var(--gray-100);
    color: var(--primary-dark);
    box-shadow: none;
    border: 1.5px solid var(--gray-200);
}

.button.secondary:hover,
.logout-btn:hover,
.back:hover {
    background: var(--gray-200);
    border-color: var(--gray-300);
}

.button.danger {
    background: var(--danger);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.button.danger:hover {
    background: #dc2626;
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.4);
}

button[type="submit"] {
    width: 100%;
}

.card,
.form-section,
.result {
    background: white;
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(59, 69, 196, 0.08);
    transition: var(--transition);
    margin-bottom: 20px;
}

.card:hover,
.form-section:hover {
    box-shadow: var(--card-shadow-lg);
    border-color: rgba(59, 69, 196, 0.12);
}

.card h2 {
    margin-top: 0;
}

.grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 24px !important;
}

@media (max-width: 900px) {
    .grid {
        grid-template-columns: 1fr !important;
    }
}

.metric {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 56px;
    height: 56px;
    padding: 0 16px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, #eef2ff 0%, #f0f9ff 100%);
    color: var(--primary);
    font-weight: 800;
    font-size: 20px;
    margin-bottom: 16px;
    box-shadow: inset 0 1px 2px rgba(59, 69, 196, 0.1);
}

.metric.success,
.metric.alt {
    background: linear-gradient(135deg, #dcfce7 0%, #d1fae5 100%);
    color: var(--success);
}

.metric.warning,
.metric.warn {
    background: linear-gradient(135deg, #fef3c7 0%, #fed7aa 100%);
    color: var(--warning);
}

.metric.danger {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: var(--danger);
}

.metric.accent {
    background: linear-gradient(135deg, #cffafe 0%, #a5f3fc 100%);
    color: var(--accent);
}

.error,
.success-box,
.info-box {
    border-radius: var(--radius);
    padding: 14px 16px;
    font-size: 14px;
    margin-bottom: 20px;
    animation: slideDown 0.3s ease-out;
}

.error {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #7f1d1d;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.success-box {
    background: linear-gradient(135deg, #dcfce7 0%, #d1fae5 100%);
    color: #065f46;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.info-box {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: #1e40af;
    border: 1px solid rgba(59, 69, 196, 0.2);
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.04);
}

thead {
    background: var(--gray-50);
    border-bottom: 2px solid var(--gray-200);
}

th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--primary-dark);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--gray-200);
    color: var(--gray-700);
    font-size: 14px;
}

tbody tr {
    transition: var(--transition);
}

tbody tr:hover {
    background: var(--gray-50);
}

tbody tr:last-child td {
    border-bottom: none;
}

.note {
    background: linear-gradient(135deg, #fef3c7 0%, #fed7aa 100%);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: var(--radius);
    padding: 14px 16px;
    color: #92400e;
    font-size: 14px;
    margin-top: 16px;
    line-height: 1.6;
}

.steps {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.step {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1.5px solid rgba(59, 69, 196, 0.2);
    border-radius: var(--radius);
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--primary);
    transition: var(--transition);
}

.step:hover {
    background: linear-gradient(135deg, #e0f2fe 0%, #cffafe 100%);
    border-color: rgba(59, 69, 196, 0.4);
}

.step.completed {
    background: linear-gradient(135deg, #dcfce7 0%, #d1fae5 100%);
    border-color: rgba(16, 185, 129, 0.2);
    color: var(--success);
}
/* ── MODAL STYLES ── */
.modal-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-backdrop[aria-hidden="false"] {
    display: flex;
}

.modal-panel {
    background: white;
    border-radius: var(--radius-lg);
    padding: 32px;
    max-width: 600px;
    width: 100%;
    min-width: 300px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.2);
    border: 1px solid rgba(59, 69, 196, 0.08);
    animation: slideDown 0.3s ease-out;
    max-height: 90vh;
    overflow-y: auto;
    min-height: auto;
}

.modal-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e4e6f0;
}

.modal-title > div {
    flex: 1;
}

.modal-title h2 {
    margin: 0 0 6px 0;
    font-size: 22px;
}

.modal-title p {
    margin: 0;
    font-size: 14px;
    color: var(--gray-500);
}

.modal-title .button {
    flex-shrink: 0;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .modal-panel {
        padding: 24px;
    }
    
    .modal-title {
        flex-direction: column;
        gap: 14px;
    }
    
    .modal-title .button {
        width: 100%;
    }

    body {
        padding: 20px 16px;
        padding-top: 100px;
    }

    .admin-navbar {
        padding: 8px 16px;
        height: 64px;
    }

    header {
        flex-direction: column;
        padding: 24px;
    }

    header > div:first-child {
        flex: 1;
        width: 100%;
    }

    header button,
    header .button {
        width: 100%;
    }

    .card,
    .form-section,
    .panel {
        padding: 20px;
    }

    h1 {
        font-size: 28px;
    }

    h2 {
        font-size: 18px;
    }

    .grid {
        gap: 16px;
    }

    .steps {
        grid-template-columns: 1fr;
    }

    table {
        font-size: 13px;
    }

    th,
    td {
        padding: 12px;
    }

    button,
    .button {
        padding: 10px 16px;
        font-size: 13px;
    }
}
@media (max-width: 768px) {
    body {
        padding: 20px 16px;
        padding-top: 100px;
    }

    .admin-navbar {
        padding: 8px 16px;
        height: 64px;
    }

    header {
        flex-direction: column;
        padding: 24px;
    }

    header > div:first-child {
        flex: 1;
        width: 100%;
    }

    header button,
    header .button {
        width: 100%;
    }

    .card,
    .form-section,
    .panel {
        padding: 20px;
    }

    h1 {
        font-size: 28px;
    }

    h2 {
        font-size: 18px;
    }

    .grid {
        gap: 16px;
    }

    .steps {
        grid-template-columns: 1fr;
    }

    table {
        font-size: 13px;
    }

    th,
    td {
        padding: 12px;
    }

    button,
    .button {
        padding: 10px 16px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 16px;
        padding-top: 100px;
    }

    header {
        padding: 16px;
        gap: 12px;
    }

    h1 {
        font-size: 22px;
    }

    h2 {
        font-size: 16px;
    }

    .panel {
        padding: 20px;
    }

    button,
    .button {
        width: 100%;
    }

    input,
    textarea,
    select {
        font-size: 16px;
    }

    table {
        display: block;
        overflow-x: auto;
    }

    .quote-form-grid {
        grid-template-columns: 1fr !important;
    }

    .quote-form-grid .form-group.wide {
        grid-column: 1 !important;
    }
}

/* ── QUOTE FORM GRID ── */
.quote-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.quote-form-grid .form-group.wide {
    grid-column: 1 / -1;
}
