@import url('https://fonts.googleapis.com/css2?family=Abril+Fatface&family=Manrope:wght@400;500;600;700;800&display=swap');

/* ── Variables ── */
:root {
    --navy: #1B1F5E;
    --navy-light: #2A2F7A;
    --navy-dark: #0F1242;
    --navy-950: #080A2E;
    --red: #E63329;
    --red-light: #FF4D42;
    --red-dark: #C42B22;
    --silver: #C5C7D0;
    --silver-light: #E8E9EE;
    --bg-alt: #F7F8FC;
    --white: #FFFFFF;

    --font-body: 'Manrope', sans-serif;
    --font-display: 'Abril Fatface', serif;

    --radius-sm: 12px;
    --radius: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --radius-full: 9999px;

    --shadow-xs: 0 1px 3px rgba(27,31,94,0.04);
    --shadow-sm: 0 2px 8px rgba(27,31,94,0.06);
    --shadow: 0 8px 32px rgba(27,31,94,0.06);
    --shadow-lg: 0 20px 60px rgba(27,31,94,0.1);
    --shadow-xl: 0 32px 80px rgba(27,31,94,0.16);

    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-out: cubic-bezier(0, 0, 0.2, 1);
    --duration: 0.3s;
}

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

body {
    font-family: var(--font-body);
    background: var(--bg-alt);
    color: #333;
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.9rem 1.8rem;
    border: none;
    border-radius: var(--radius-full);
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    letter-spacing: -0.01em;
}

.btn:hover { transform: translateY(-2px); }

.btn-primary {
    background: linear-gradient(135deg, var(--navy), var(--navy-light));
    color: var(--white);
    box-shadow: 0 4px 16px rgba(27,31,94,0.25);
}
.btn-primary:hover { box-shadow: 0 8px 24px rgba(27,31,94,0.35); }

.btn-accent {
    background: linear-gradient(135deg, var(--red), var(--red-light));
    color: var(--white);
    box-shadow: 0 4px 16px rgba(230,51,41,0.25);
}
.btn-accent:hover { box-shadow: 0 8px 24px rgba(230,51,41,0.35); }

.btn-secondary {
    background: var(--white);
    color: var(--navy);
    border: 1.5px solid var(--silver-light);
}
.btn-secondary:hover { border-color: var(--navy); }

.btn-danger {
    background: linear-gradient(135deg, var(--red-dark), var(--red));
    color: var(--white);
    box-shadow: 0 4px 16px rgba(230,51,41,0.2);
}

.btn-sm { padding: 0.6rem 1.2rem; font-size: 14px; }
.btn-xs { padding: 0.45rem 0.9rem; font-size: 13px; }
.btn-lg { padding: 1.1rem 2.2rem; font-size: 17px; }
.btn-block { width: 100%; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: 50%; }

/* ── Forms ── */
.form-group { margin-bottom: 20px; }

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    color: var(--navy);
    font-size: 15px;
    letter-spacing: -0.01em;
}

.form-group label .required { color: var(--red); }

.form-input, .form-select {
    width: 100%;
    padding: 0.9rem 1.1rem;
    border: 1.5px solid var(--silver-light);
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 16px;
    color: var(--navy);
    background: var(--white);
    transition: all var(--duration) var(--ease);
}

.form-input:focus, .form-select:focus {
    outline: none;
    border-color: var(--navy);
    box-shadow: 0 0 0 4px rgba(27,31,94,0.08);
}

.form-input::placeholder { color: var(--silver); }

/* ── Login Page ── */
.login-page {
    min-height: 100vh;
    display: flex;
}

.login-left {
    flex: 1;
    background: linear-gradient(135deg, var(--navy-950) 0%, var(--navy) 50%, var(--navy-light) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 60px;
    position: relative;
    overflow: hidden;
}

.login-left::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(230,51,41,0.08) 0%, transparent 70%);
}

.login-left::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -30%;
    width: 80%;
    height: 80%;
    background: radial-gradient(circle, rgba(42,47,122,0.3) 0%, transparent 70%);
}

.login-brand {
    position: relative;
    z-index: 1;
    text-align: center;
}

.login-brand img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.2);
    margin-bottom: 24px;
}

.login-brand h1 {
    font-family: var(--font-display);
    color: var(--white);
    font-size: 2.5rem;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.login-brand .tagline {
    color: rgba(255,255,255,0.6);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.login-features {
    position: relative;
    z-index: 1;
    margin-top: 48px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.login-feature {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255,255,255,0.7);
    font-size: 16px;
}

.login-feature .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--red);
    flex-shrink: 0;
}

.login-right {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    background: var(--white);
}

.login-form-container {
    width: 100%;
    max-width: 400px;
}

.login-form-container .form-header {
    margin-bottom: 32px;
}

.login-form-container .form-header h2 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--navy);
    letter-spacing: -0.03em;
    margin-bottom: 8px;
}

.login-form-container .form-header p {
    color: var(--silver);
    font-size: 16px;
}

.login-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-alt);
    padding: 4px;
    border-radius: var(--radius);
    margin-bottom: 28px;
}

.login-tab {
    flex: 1;
    padding: 12px 16px;
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    color: var(--silver);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    border: none;
    background: transparent;
    font-family: var(--font-body);
}

.login-tab.active {
    background: var(--white);
    color: var(--navy);
    box-shadow: var(--shadow-sm);
}

.login-tab:hover:not(.active) { color: var(--navy); }

.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0;
    color: var(--silver);
    font-size: 12px;
}

.divider::before, .divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--silver-light);
}

/* ── Navbar ── */
.navbar {
    background: var(--navy);
    padding: 0 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
}

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

.nav-brand img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.2);
}

.nav-brand .brand-text {
    color: var(--white);
    font-weight: 800;
    font-size: 16px;
    letter-spacing: -0.01em;
}

.nav-brand .brand-sub {
    color: rgba(255,255,255,0.5);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link {
    color: rgba(255,255,255,0.7);
    font-size: 15px;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    transition: all var(--duration) var(--ease);
}

.nav-link:hover { background: rgba(255,255,255,0.1); color: var(--white); }
.nav-link.active { background: rgba(255,255,255,0.12); color: var(--white); }

.nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--white);
}

.nav-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--red), var(--red-light));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--white);
}

.nav-user-info .nav-user-name {
    font-size: 15px;
    font-weight: 700;
}

.nav-user-info .nav-user-role {
    font-size: 12px;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.nav-logout {
    color: rgba(255,255,255,0.5);
    font-size: 14px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(255,255,255,0.15);
    transition: all var(--duration) var(--ease);
}

.nav-logout:hover {
    border-color: rgba(255,255,255,0.4);
    color: var(--white);
}

/* ── Dashboard Layout ── */
.page-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 32px 24px;
}

/* ── Welcome Section ── */
.welcome-section {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
}

.welcome-text h1 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--navy);
    letter-spacing: -0.03em;
}

.welcome-text p {
    color: var(--silver);
    font-size: 16px;
    margin-top: 6px;
}

.welcome-date {
    text-align: right;
    color: var(--silver);
    font-size: 13px;
}

.welcome-date .date {
    font-weight: 700;
    color: var(--navy);
    font-size: 14px;
}

/* ── Stats Cards ── */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid rgba(27,31,94,0.06);
    box-shadow: var(--shadow-xs);
    transition: all var(--duration) var(--ease);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 16px;
}

.stat-icon.navy { background: rgba(27,31,94,0.08); }
.stat-icon.red { background: rgba(230,51,41,0.08); }
.stat-icon.green { background: rgba(34,139,34,0.08); }
.stat-icon.blue { background: rgba(13,71,161,0.08); }

.stat-value {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--navy);
    line-height: 1;
}

.stat-label {
    font-size: 14px;
    color: var(--silver);
    margin-top: 6px;
    font-weight: 500;
}

/* ── HSN Search Section ── */
.search-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 32px;
    border: 1px solid rgba(27,31,94,0.06);
    box-shadow: var(--shadow-xs);
    margin-bottom: 32px;
}

.search-card .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--navy);
    letter-spacing: -0.02em;
}

.section-title::after {
    content: '';
    display: block;
    width: 30px;
    height: 3px;
    background: linear-gradient(90deg, var(--red), var(--navy));
    border-radius: 3px;
    margin-top: 6px;
}

.search-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.search-bar input {
    flex: 1;
    padding: 16px 22px;
    border: 2px solid var(--silver-light);
    border-radius: var(--radius-full);
    font-family: var(--font-body);
    font-size: 17px;
    font-weight: 600;
    color: var(--navy);
    transition: all var(--duration) var(--ease);
    letter-spacing: 0.05em;
}

.search-bar input:focus {
    outline: none;
    border-color: var(--navy);
    box-shadow: 0 0 0 4px rgba(27,31,94,0.08);
}

.search-bar input::placeholder {
    color: var(--silver);
    font-weight: 500;
    letter-spacing: 0;
}

.search-empty {
    text-align: center;
    padding: 48px 20px;
}

.search-empty-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--bg-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin: 0 auto 16px;
}

.search-empty h4 {
    color: var(--navy);
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.search-empty p {
    color: var(--silver);
    font-size: 15px;
}

.coming-soon-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: rgba(230,51,41,0.06);
    color: var(--red);
    font-size: 11px;
    font-weight: 700;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.coming-soon-badge .pulse {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--red);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.7); }
}

/* ── Feature Cards Grid ── */
.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.feature-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 28px;
    border: 1px solid rgba(27,31,94,0.06);
    box-shadow: var(--shadow-xs);
    transition: all var(--duration) var(--ease);
    position: relative;
    overflow: hidden;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.feature-card .feature-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 16px;
    background: rgba(27,31,94,0.06);
}

.feature-card h4 {
    font-size: 15px;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 6px;
}

.feature-card p {
    font-size: 13px;
    color: var(--silver);
    line-height: 1.5;
}

.feature-card .feature-status {
    margin-top: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.feature-status.ready { color: #228B22; }
.feature-status.coming { color: var(--red); }

/* ── Quick Actions ── */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.action-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid rgba(27,31,94,0.06);
    box-shadow: var(--shadow-xs);
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: all var(--duration) var(--ease);
}

.action-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
    border-color: var(--navy);
}

.action-card .action-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background: var(--bg-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.action-card h4 { font-size: 16px; font-weight: 700; color: var(--navy); }
.action-card p { font-size: 14px; color: var(--silver); margin-top: 4px; }

/* ── Admin Panel ── */
.admin-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 32px;
    border: 1px solid rgba(27,31,94,0.06);
    box-shadow: var(--shadow-xs);
    margin-bottom: 24px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.admin-stats {
    display: flex;
    gap: 24px;
}

.admin-stat {
    text-align: center;
}

.admin-stat .num {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--navy);
}

.admin-stat .lbl {
    font-size: 11px;
    color: var(--silver);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ── Table ── */
.table-container { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

table th {
    padding: 14px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 700;
    color: var(--silver);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--silver-light);
    background: var(--bg-alt);
}

table td {
    padding: 16px 16px;
    font-size: 15px;
    border-bottom: 1px solid rgba(27,31,94,0.04);
    color: #444;
}

table tr:hover { background: rgba(27,31,94,0.015); }

.badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-admin { background: rgba(27,31,94,0.08); color: var(--navy); }
.badge-staff { background: rgba(13,71,161,0.08); color: #0d47a1; }
.badge-customer { background: rgba(34,139,34,0.08); color: #228B22; }
.badge-active { background: rgba(34,139,34,0.06); color: #228B22; }
.badge-inactive { background: rgba(230,51,41,0.06); color: var(--red); }

.action-btns { display: flex; gap: 6px; }

/* ── Modal ── */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(8,10,46,0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active { display: flex; }

.modal {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 32px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: modalIn 0.3s var(--ease);
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal h3 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--navy);
    margin-bottom: 24px;
    letter-spacing: -0.02em;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 24px;
}

/* ── Alerts ── */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 16px;
    display: none;
}

.alert-error { background: rgba(230,51,41,0.06); color: var(--red); border: 1px solid rgba(230,51,41,0.1); }
.alert-success { background: rgba(34,139,34,0.06); color: #228B22; border: 1px solid rgba(34,139,34,0.1); }

/* ── Footer ── */
.portal-footer {
    background: linear-gradient(180deg, var(--navy-dark) 0%, var(--navy-950) 100%);
    border-top: 3px solid;
    border-image: linear-gradient(90deg, var(--red), var(--navy-light)) 1;
    padding: 24px 32px;
    margin-top: 48px;
    text-align: center;
}

.portal-footer p {
    color: rgba(255,255,255,0.4);
    font-size: 12px;
}

.portal-footer a {
    color: rgba(255,255,255,0.6);
    transition: color var(--duration) var(--ease);
}

.portal-footer a:hover { color: var(--white); }

/* ── Responsive ── */
@media (max-width: 1024px) {
    .stats-row { grid-template-columns: repeat(2, 1fr); }
    .features-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .login-page { flex-direction: column; }
    .login-left { padding: 40px 24px; min-height: auto; }
    .login-left .login-features { display: none; }
    .login-brand h1 { font-size: 1.75rem; }
    .login-right { padding: 32px 20px; }

    .navbar { padding: 0 16px; }
    .nav-links { display: none; }
    .page-container { padding: 20px 16px; }

    .welcome-section { flex-direction: column; gap: 8px; }
    .stats-row { grid-template-columns: 1fr 1fr; }
    .features-grid { grid-template-columns: 1fr; }
    .quick-actions { grid-template-columns: 1fr; }

    .search-bar { flex-direction: column; }
    .search-bar .btn { width: 100%; }

    .admin-header { flex-direction: column; gap: 16px; align-items: flex-start; }
}

@media (max-width: 480px) {
    .stats-row { grid-template-columns: 1fr; }
    .login-tabs { flex-direction: column; }
}
