:root {
    --color-primary: #2d7a3e;
    --color-primary-hover: #1a4d26;
    --color-secondary: #1a4d26;
    --color-background: #f8fafc;
    --color-surface: #ffffff;
    --color-text: #1e293b;
    --color-text-muted: #64748b;
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    --color-border: #e2e8f0;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--color-background);
    color: var(--color-text);
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #163b1f 0%, #1a4d26 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 24px 0;
    position: fixed;
    height: 100vh;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
    z-index: 100;
    overflow-y: auto;
}

.sidebar-logo {
    font-size: 1.5rem;
    font-weight: 800;
    text-align: center;
    padding: 0 24px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 24px;
    letter-spacing: 0.5px;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.nav-menu {
    list-style: none;
    padding: 0 16px;
}

.nav-menu li a {
    display: flex;
    align-items: center;
    color: #94a3b8;
    text-decoration: none;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border: 1px solid transparent;
}

.nav-menu li a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%) scaleY(0);
    height: 60%;
    width: 4px;
    background-color: #10b981;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 0 4px 4px 0;
}

.nav-menu li a:hover {
    background-color: rgba(255, 255, 255, 0.06);
    color: #fff;
    transform: translateX(4px);
    border-color: rgba(255, 255, 255, 0.02);
}

.nav-menu li a.active {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.15) 0%, rgba(255,255,255,0.02) 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border: 1px solid rgba(16, 185, 129, 0.1);
}

.nav-menu li a.active::before {
    transform: translateY(-50%) scaleY(1);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
}

.topbar {
    background-color: var(--color-surface);
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    box-shadow: var(--shadow-sm);
    font-weight: 600;
    color: var(--color-text);
    position: sticky;
    top: 0;
    z-index: 90;
    gap: 15px;
}

.topbar-left {
    display: flex;
    align-items: center;
}

.sidebar-toggle-btn {
    background: none;
    border: none;
    font-size: 1.4rem;
    color: var(--color-text);
    cursor: pointer;
    margin-right: 15px;
    display: none;
    padding: 0;
    line-height: 1;
}

.topbar-center {
    flex-grow: 1;
    max-width: 400px;
}

.search-form {
    display: flex;
    margin: 0;
}

.search-input {
    border-radius: 20px 0 0 20px;
    border-right: none;
}

.search-btn {
    border-radius: 0 20px 20px 0;
    padding: 8px 15px;
}

.container {
    padding: 30px;
    flex: 1;
}

/* Cards & Glassmorphism */
.card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 25px;
    box-shadow: var(--shadow-md);
    margin-bottom: 25px;
    border: 1px solid var(--color-border);
    animation: fadeIn 0.5s ease-out;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Sub-cards for documents */
.doc-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 15px;
    border: 1px solid var(--color-border);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

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

.animate-fade-in-up {
    animation: fadeInUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}

/* Typography */
h1, h2, h3 {
    color: var(--color-text);
    font-weight: 700;
    margin-bottom: 15px;
}

/* Buttons */
.btn-primary {
    background-color: var(--color-primary);
    color: white;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: inline-block;
    box-shadow: 0 4px 6px rgba(45, 122, 62, 0.2);
}

.btn-primary:hover {
    background-color: var(--color-primary-hover);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 15px rgba(45, 122, 62, 0.3);
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 15px;
}

.table th, .table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
    transition: all 0.2s ease;
}

.table th {
    background-color: #f8fafc;
    color: var(--color-text-muted);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    border-top: 1px solid var(--color-border);
}

.table th:first-child {
    border-top-left-radius: var(--radius-md);
}

.table th:last-child {
    border-top-right-radius: var(--radius-md);
}

.table tbody tr {
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    background-color: var(--color-surface);
}

.table tbody tr:hover {
    background-color: #f1f5f9;
    transform: translateY(-2px) scale(1.005);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    position: relative;
    z-index: 10;
    border-radius: var(--radius-md);
}

.table tbody tr:hover td {
    border-bottom-color: transparent;
}

/* Badges */
.badge {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-success {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--color-text);
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: #f8fafc;
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(45, 122, 62, 0.1);
    background-color: #fff;
}

/* Login specific */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #1a4d26 0%, #2d7a3e 100%);
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 400px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.login-card .form-control {
    background-color: #fff;
}

/* Responsive Grid Forms */
.form-row-responsive {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    align-items: end;
}

/* Sidebar Overlay for Mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: -260px;
        height: 100vh;
        width: 260px;
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        z-index: 1000;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.25);
    }
    .sidebar.active {
        transform: translateX(260px);
    }
    .main-content {
        margin-left: 0;
        width: 100%;
    }
    .sidebar-toggle-btn {
        display: block !important;
    }
    .topbar {
        padding: 0 15px;
    }
    .container {
        padding: 15px;
    }
    .topbar-title {
        display: none;
    }
    .topbar-center {
        max-width: none;
    }
    .topbar-right {
        display: none;
    }
}
