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

:root {
    --primary: #8e44ad;
    --primary-light: #f4ecf7;
    --primary-dark: #7d3c98;
    --secondary: #1abc9c;
    --dark: #2c3e50;
    --light: #f8f9fa;
    --gray: #95a5a6;
    --border: #e2e8f0;
    --success: #2ecc71;
    --warning: #f1c40f;
    --danger: #e74c3c;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: #f3f4f6;
    color: var(--dark);
    line-height: 1.5;
}

/* Auth Pages */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.auth-card {
    background: white;
    width: 100%;
    max-width: 450px;
    padding: 2.5rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.auth-logo svg {
    width: 32px;
    height: 32px;
    fill: var(--primary);
}

/* App Layout */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--dark);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: all 0.3s;
}

.sidebar-brand {
    padding: 1.5rem;
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-brand svg {
    width: 28px;
    height: 28px;
    fill: #1abc9c;
}

.sidebar-menu {
    list-style: none;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-grow: 1;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #a0aec0;
    text-decoration: none;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.2s;
}

.sidebar-menu a:hover,
.sidebar-menu li.active a {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.sidebar-menu li.active a {
    background: var(--primary);
}

.sidebar-user {
    padding: 1rem 1.5rem;
    background: rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9rem;
}

.sidebar-user-info {
    display: flex;
    flex-direction: column;
}

.sidebar-user-name {
    font-weight: 600;
    color: white;
}

.sidebar-user-role {
    font-size: 0.75rem;
    color: #a0aec0;
    text-transform: uppercase;
}

/* Main Content Area */
.main-content {
    margin-left: 260px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.navbar {
    height: 60px;
    background: white;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
}

.navbar-title {
    font-size: 1.2rem;
    font-weight: 600;
}

.content-body {
    padding: 2rem;
    flex-grow: 1;
}

/* Stats Cards Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-left: 4px solid var(--primary);
}

.stat-card.blue { border-left-color: #3498db; }
.stat-card.green { border-left-color: var(--success); }
.stat-card.red { border-left-color: var(--danger); }
.stat-card.yellow { border-left-color: var(--warning); }

.stat-info h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--gray);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.stat-info p {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dark);
}

.stat-icon {
    font-size: 2rem;
    opacity: 0.3;
}

/* Standard Components */
.card {
    background: white;
    border-radius: 0.75rem;
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--secondary);
    color: white;
}

.btn-secondary:hover {
    background: #16a085;
}

.btn-light {
    background: #edf2f7;
    color: var(--dark);
}

.btn-light:hover {
    background: #e2e8f0;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

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

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.form-control {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .form-group {
    flex: 1;
}

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

.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.table th {
    background: #f7fafc;
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--gray);
    text-transform: uppercase;
    border-bottom: 1px solid var(--border);
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
    vertical-align: middle;
}

.table tr:hover {
    background: #f8fafc;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-success { background: #d4edda; color: #155724; }
.badge-warning { background: #fff3cd; color: #856404; }
.badge-danger { background: #f8d7da; color: #721c24; }
.badge-info { background: #d1ecf1; color: #0c5460; }

/* Alert Messages */
.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-danger { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* Autocomplete Suggestion Dropdown */
.autocomplete-wrapper {
    position: relative;
}

.autocomplete-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 0.5rem 0.5rem;
    box-shadow: var(--shadow-md);
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
}

.autocomplete-suggestion {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.autocomplete-suggestion:hover {
    background: var(--primary-light);
}

.autocomplete-suggestion strong {
    color: var(--primary);
}

/* File Upload Signature Preview */
.sig-preview {
    margin-top: 0.5rem;
    max-width: 150px;
    height: 60px;
    border: 1px dashed var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
    border-radius: 0.25rem;
    overflow: hidden;
}

.sig-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Responsive sidebar hides on mobile */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-260px);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
}
