/**
 * Sky Precision Africa ERP - Modern UI Theme
 * Brand Colors: Precision Emerald Green (#166534), Aerial Deep Blue (#0f172a), Accent Cyan (#06b6d4)
 */

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

:root {
    --primary-color: #15803d;
    --primary-hover: #166534;
    --primary-light: #dcfce7;
    --secondary-color: #0f172a;
    --accent-color: #0284c7;
    --sidebar-width: 260px;
    --topbar-height: 65px;
    --bg-light: #f8fafc;
    --card-border-radius: 12px;
    --card-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
}

body {
    font-family: 'Cairo', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-light);
    color: #334155;
    min-height: 100vh;
}

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

/* Sidebar */
.app-sidebar {
    width: var(--sidebar-width);
    background: #0f172a;
    color: #94a3b8;
    flex-shrink: 0;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    z-index: 1000;
}

.sidebar-brand {
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid #1e293b;
    background: #090e1a;
}

.sidebar-brand .brand-logo-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #16a34a, #0284c7);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.2rem;
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.4);
}

.sidebar-brand .brand-title {
    font-weight: 700;
    font-size: 1.05rem;
    color: #f8fafc;
    margin: 0;
    line-height: 1.2;
}

.sidebar-brand .brand-subtitle {
    font-size: 0.72rem;
    color: #10b981;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-menu {
    list-style: none;
    padding: 1rem 0.75rem;
    margin: 0;
    flex-grow: 1;
    overflow-y: auto;
}

.sidebar-heading {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: #64748b;
    font-weight: 700;
    letter-spacing: 0.8px;
    padding: 0.75rem 0.75rem 0.25rem;
}

.sidebar-item {
    margin-bottom: 0.25rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.65rem 0.9rem;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.sidebar-link i {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    color: #94a3b8;
    transition: color 0.2s ease;
}

.sidebar-link:hover {
    background: #1e293b;
    color: #ffffff;
}

.sidebar-link:hover i {
    color: #34d399;
}

.sidebar-link.active {
    background: linear-gradient(90deg, #15803d, #16a34a);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(22, 128, 61, 0.3);
}

.sidebar-link.active i {
    color: #ffffff;
}

/* Main Content Area */
.app-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Navbar */
.app-navbar {
    height: var(--topbar-height);
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.75rem;
    position: sticky;
    top: 0;
    z-index: 900;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.navbar-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #dcfce7;
    color: #15803d;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #bbf7d0;
}

/* Cards & Stats */
.card-stat {
    border: none;
    border-radius: var(--card-border-radius);
    box-shadow: var(--card-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}

.card-stat:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.08);
}

.stat-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.card-custom {
    border: none;
    border-radius: var(--card-border-radius);
    box-shadow: var(--card-shadow);
    background: #ffffff;
}

.card-header-custom {
    background: transparent;
    border-bottom: 1px solid #f1f5f9;
    padding: 1.1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Tables */
.table-custom th {
    background-color: #f8fafc;
    color: #64748b;
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
    border-top: none;
    padding: 0.85rem 1rem;
}

.table-custom td {
    padding: 0.85rem 1rem;
    vertical-align: middle;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
}

.table-custom tbody tr:hover {
    background-color: #f8fafc;
}

/* Status Badges */
.badge-status {
    padding: 0.4em 0.75em;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 6px;
}

.badge-active, .badge-paid, .badge-completed, .badge-available {
    background-color: #dcfce7;
    color: #166534;
}

.badge-inactive, .badge-unpaid, .badge-damaged, .badge-cancelled {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-scheduled, .badge-pending, .badge-partially_paid {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-in_progress, .badge-in_use, .badge-maintenance {
    background-color: #e0f2fe;
    color: #0369a1;
}

/* Buttons */
.btn-primary {
    background: #15803d;
    border-color: #15803d;
    font-weight: 600;
    padding: 0.5rem 1.1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(21, 128, 61, 0.2);
}

.btn-primary:hover, .btn-primary:focus {
    background: #166534;
    border-color: #166534;
}

.btn-outline-primary {
    color: #15803d;
    border-color: #15803d;
}

.btn-outline-primary:hover {
    background: #15803d;
    border-color: #15803d;
    color: #ffffff;
}

/* Forms */
.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    padding: 0.55rem 0.85rem;
    font-size: 0.92rem;
}

.form-control:focus, .form-select:focus {
    border-color: #15803d;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
}

.form-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: #475569;
    margin-bottom: 0.4rem;
}

/* Login Page Theme */
.login-body {
    background: linear-gradient(135deg, #090e1a 0%, #0f172a 50%, #064e3b 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1.5rem;
}

.login-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
    max-width: 440px;
    width: 100%;
    overflow: hidden;
}

.login-header {
    background: #0f172a;
    padding: 2.25rem 2rem;
    text-align: center;
    color: #ffffff;
    border-bottom: 3px solid #15803d;
}
