@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Poppins:wght@500;600;700&display=swap');

:root {
    --primary-navy: #001A3F;
    --primary-navy-dark: #00122e;
    --emerald-primary: #008647;
    --emerald-hover: #059669;
    --emerald-accent: #2bb580;
    --emerald-light: #f6fff4;
    --emerald-subtle: #e6f4ea;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 14px rgba(19,40,68,0.08);
    --shadow-lg: 0 10px 25px rgba(19,40,68,0.12);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --font-main: 'Inter', sans-serif;
    --font-heading: 'Poppins', sans-serif;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--gray-50);
    color: var(--gray-800);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.5;
}

/* Header & Navbar */
header {
    background: var(--primary-navy);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.nav-logo-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--emerald-accent), var(--emerald-primary));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 20px;
    box-shadow: 0 4px 10px rgba(0,134,71,0.3);
}

.nav-logo-text {
    display: flex;
    flex-direction: column;
}

.nav-logo-text .brand {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.3px;
}

.nav-logo-text .brand span {
    color: var(--emerald-accent);
}

.nav-logo-text .tagline {
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-400);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    color: var(--gray-300);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: #ffffff;
    background: rgba(255,255,255,0.08);
}

.nav-link.active {
    color: #ffffff;
    background: var(--emerald-primary);
    font-weight: 600;
}

.nav-link svg {
    width: 18px;
    height: 18px;
}

/* User Profile Menu */
.user-dropdown {
    position: relative;
    margin-left: 12px;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px 6px 6px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 30px;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s;
}

.user-btn:hover {
    background: rgba(255,255,255,0.12);
}

.user-avatar {
    width: 34px;
    height: 34px;
    background: var(--emerald-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: #ffffff;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
}

.dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: 220px;
    background: #ffffff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-200);
    padding: 8px;
    display: none;
    flex-direction: column;
    z-index: 1100;
}

.dropdown-menu.show {
    display: flex;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: var(--gray-700);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    transition: all 0.2s;
}

.dropdown-item:hover {
    background: var(--gray-100);
    color: var(--primary-navy);
}

.dropdown-item.danger:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* Nav Menu Dropdowns & Submenus */
.nav-dropdown {
    position: relative;
    display: inline-block;
}

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 195px;
    background: #ffffff;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--gray-200);
    padding: 6px;
    display: none;
    flex-direction: column;
    z-index: 1100;
}

.nav-dropdown:hover > .nav-dropdown-menu,
.nav-dropdown-menu.show {
    display: flex;
}

.nav-dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 14px;
    color: var(--gray-700);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    transition: all 0.15s ease;
}

.nav-dropdown-item:hover {
    background: var(--gray-100);
    color: var(--primary-navy);
}

.nav-dropdown-item.active {
    background: var(--emerald-subtle);
    color: var(--emerald-primary);
    font-weight: 600;
}

.nav-dropdown-submenu {
    position: relative;
}

/* Invisible bridge element connecting parent menu item to flyout submenu */
.nav-dropdown-submenu::after {
    content: '';
    position: absolute;
    top: 0;
    right: -12px;
    width: 16px;
    height: 100%;
    background: transparent;
}

.nav-sub-dropdown-menu {
    position: absolute;
    top: -6px;
    left: calc(100% - 2px);
    min-width: 195px;
    background: #ffffff;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
    border: 1px solid var(--gray-200);
    padding: 6px;
    display: none;
    flex-direction: column;
    z-index: 1200;
}

.nav-dropdown-submenu:hover > .nav-sub-dropdown-menu,
.nav-sub-dropdown-menu.show {
    display: flex;
}

.dropdown-divider {
    height: 1px;
    background: var(--gray-200);
    margin: 6px 0;
}

/* Page Main Container */
main {
    flex: 1;
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
    padding: 32px 24px;
}

/* Cards & Panels */
.card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
    margin-bottom: 24px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gray-200);
}

.card-title {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-navy);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-main);
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--emerald-primary);
    color: #ffffff;
    box-shadow: 0 3px 10px rgba(0,134,71,0.2);
}

.btn-primary:hover {
    background: var(--emerald-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.btn-secondary:hover {
    background: var(--gray-200);
    color: var(--gray-900);
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--emerald-primary);
    color: var(--emerald-primary);
}

.btn-outline:hover {
    background: var(--emerald-light);
}

.btn-danger {
    background: #ef4444;
    color: #ffffff;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-sm {
    padding: 7px 12px;
    font-size: 12.5px;
    border-radius: var(--radius-sm);
}

/* Form Controls */
.form-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 20px;
}

.col-12 { grid-column: span 12; }
.col-9 { grid-column: span 9; }
.col-8 { grid-column: span 8; }
.col-7 { grid-column: span 7; }
.col-6 { grid-column: span 6; }
.col-5 { grid-column: span 5; }
.col-4 { grid-column: span 4; }
.col-3 { grid-column: span 3; }
.col-2 { grid-column: span 2; }
.col-1 { grid-column: span 1; }

@media (max-width: 992px) {
    .col-1 { grid-column: span 2; }
}

@media (max-width: 768px) {
    .col-12, .col-9, .col-8, .col-7, .col-6, .col-5, .col-4, .col-3, .col-2, .col-1 {
        grid-column: span 12;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.form-control {
    width: 100%;
    min-width: 0;
    padding: 11px 14px;
    font-size: 14px;
    font-family: var(--font-main);
    color: var(--gray-900);
    background: var(--gray-50);
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-md);
    outline: none;
    transition: all 0.2s ease;
}

.form-control:focus {
    border-color: var(--emerald-primary);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(0,134,71,0.12);
}

.form-control.is-invalid {
    border-color: #ef4444;
    background: #fff5f5;
}

.invalid-feedback {
    font-size: 12px;
    color: #dc2626;
    font-weight: 500;
}

/* Footer */
footer {
    background: var(--primary-navy-dark);
    color: var(--gray-400);
    padding: 24px 0;
    margin-top: auto;
    font-size: 13px;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.footer-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
