/* ==========================================================================
   KAVISADI INDUSTRIES / UPALI PAINT BRUSHERS - ADMIN PANEL STYLESHEET
   ========================================================================== */

:root {
    --adm-navy: #06162d;
    --adm-navy-light: #0d2345;
    --adm-primary: #0066cc;
    --adm-primary-hover: #0052a3;
    --adm-accent: #00d2ff;
    --adm-bg: #f4f7fb;
    --adm-card-bg: #ffffff;
    --adm-border: #e2e8f0;
    --adm-text-main: #1e293b;
    --adm-text-muted: #64748b;
    --adm-sidebar-width: 270px;
    --adm-topbar-height: 70px;
    --adm-radius: 14px;
    --adm-radius-sm: 8px;
    --adm-shadow: 0 4px 20px rgba(6, 22, 45, 0.06);
    --adm-shadow-hover: 0 10px 30px rgba(6, 22, 45, 0.12);
}

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

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--adm-bg);
    color: var(--adm-text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ==========================================================================
   LAYOUT STRUCTURE
   ========================================================================== */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* SIDEBAR */
.admin-sidebar {
    width: var(--adm-sidebar-width);
    background: linear-gradient(180deg, var(--adm-navy) 0%, #041021 100%);
    color: #ffffff;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 25px rgba(0, 0, 0, 0.15);
}

.sidebar-brand {
    height: var(--adm-topbar-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.15);
}

.sidebar-brand-img {
    height: 42px;
    width: auto;
    object-fit: contain;
}

.sidebar-brand-title {
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #ffffff;
    line-height: 1.1;
}

.sidebar-brand-sub {
    font-size: 0.68rem;
    color: var(--adm-accent);
    font-weight: 600;
    letter-spacing: 0.3px;
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem 0.85rem;
}

.sidebar-menu::-webkit-scrollbar {
    width: 4px;
}
.sidebar-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.menu-heading {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #94a3b8;
    letter-spacing: 1px;
    padding: 0.75rem 0.75rem 0.35rem 0.75rem;
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

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

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    border-radius: var(--adm-radius-sm);
    transition: all 0.2s ease;
}

.sidebar-link i.nav-icon {
    width: 24px;
    font-size: 1.05rem;
    margin-right: 0.85rem;
    color: #64748b;
    transition: color 0.2s ease;
}

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

.sidebar-link:hover i.nav-icon {
    color: var(--adm-accent);
}

.sidebar-link.active {
    color: #ffffff;
    background: linear-gradient(90deg, var(--adm-primary) 0%, #0077e6 100%);
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 102, 204, 0.35);
}

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

.sidebar-badge {
    margin-left: auto;
    font-size: 0.72rem;
    padding: 0.25rem 0.55rem;
    border-radius: 20px;
    font-weight: 700;
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.2);
}

.admin-user-pill {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0066cc, #00d2ff);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    flex-shrink: 0;
}

/* MAIN CONTENT AREA */
.admin-main {
    flex: 1;
    margin-left: var(--adm-sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* TOPBAR */
.admin-topbar {
    height: var(--adm-topbar-height);
    background: #ffffff;
    border-bottom: 1px solid var(--adm-border);
    position: sticky;
    top: 0;
    z-index: 1020;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.75rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

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

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.sidebar-toggle-btn {
    border: none;
    background: #f1f5f9;
    color: var(--adm-text-main);
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sidebar-toggle-btn:hover {
    background: #e2e8f0;
    color: var(--adm-primary);
}

.page-title-badge {
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--adm-navy);
}

.btn-view-site {
    background: #f8fafc;
    border: 1px solid var(--adm-border);
    color: var(--adm-text-main);
    padding: 0.45rem 0.95rem;
    border-radius: 30px;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
}

.btn-view-site:hover {
    background: var(--adm-primary);
    color: #ffffff;
    border-color: var(--adm-primary);
}

.notification-pill {
    position: relative;
    color: var(--adm-text-main);
    font-size: 1.1rem;
    text-decoration: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #f8fafc;
    border: 1px solid var(--adm-border);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.notification-pill:hover {
    background: #e2e8f0;
    color: var(--adm-primary);
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.4rem;
    border-radius: 10px;
    border: 2px solid #ffffff;
}

/* CONTENT BODY */
.admin-content {
    flex: 1;
    padding: 2rem 1.75rem;
}

/* ==========================================================================
   CARDS & STATS WIDGETS
   ========================================================================== */
.adm-card {
    background: var(--adm-card-bg);
    border-radius: var(--adm-radius);
    border: 1px solid var(--adm-border);
    box-shadow: var(--adm-shadow);
    padding: 1.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.stat-widget {
    position: relative;
    overflow: hidden;
}

.stat-widget-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.45rem;
    margin-bottom: 1rem;
}

.icon-blue {
    background: #e0f2fe;
    color: #0284c7;
}

.icon-green {
    background: #dcfce7;
    color: #16a34a;
}

.icon-amber {
    background: #fef3c7;
    color: #d97706;
}

.icon-purple {
    background: #f3e8ff;
    color: #9333ea;
}

.stat-widget-val {
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--adm-navy);
    line-height: 1.2;
}

.stat-widget-lbl {
    font-size: 0.85rem;
    color: var(--adm-text-muted);
    font-weight: 500;
    margin-top: 0.25rem;
}

/* ==========================================================================
   TABLES & BADGES
   ========================================================================== */
.adm-table-wrapper {
    background: #ffffff;
    border-radius: var(--adm-radius);
    border: 1px solid var(--adm-border);
    box-shadow: var(--adm-shadow);
    overflow: hidden;
}

.adm-table-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--adm-border);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.adm-table {
    width: 100%;
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0;
}

.adm-table th {
    background: #f8fafc;
    color: #475569;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    padding: 0.95rem 1.25rem;
    border-bottom: 1px solid var(--adm-border);
    white-space: nowrap;
}

.adm-table td {
    padding: 1rem 1.25rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.88rem;
    color: #334155;
}

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

/* BADGES */
.badge-status {
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.badge-status-new {
    background: #fee2e2;
    color: #dc2626;
}

.badge-status-contacted {
    background: #fef3c7;
    color: #b45309;
}

.badge-status-quoted {
    background: #e0f2fe;
    color: #0369a1;
}

.badge-status-completed {
    background: #dcfce7;
    color: #15803d;
}

.badge-status-cancelled {
    background: #f1f5f9;
    color: #64748b;
}

.badge-status-active {
    background: #dcfce7;
    color: #15803d;
}

.badge-status-inactive {
    background: #f1f5f9;
    color: #94a3b8;
}

/* BUTTONS */
.btn-adm-primary {
    background: linear-gradient(135deg, var(--adm-primary) 0%, #0077e6 100%);
    color: #ffffff;
    font-weight: 600;
    font-size: 0.88rem;
    padding: 0.55rem 1.25rem;
    border-radius: 8px;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.25);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.btn-adm-primary:hover {
    background: linear-gradient(135deg, #0052a3 0%, var(--adm-primary) 100%);
    color: #ffffff;
    box-shadow: 0 6px 18px rgba(0, 102, 204, 0.35);
    transform: translateY(-1px);
}

.btn-adm-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 6px;
}

.btn-adm-danger {
    background: #fee2e2;
    color: #dc2626;
    border: none;
    font-weight: 600;
}
.btn-adm-danger:hover {
    background: #dc2626;
    color: #ffffff;
}

.btn-adm-outline {
    background: transparent;
    border: 1px solid var(--adm-border);
    color: var(--adm-text-main);
    font-weight: 600;
}
.btn-adm-outline:hover {
    background: #f1f5f9;
}

/* ==========================================================================
   LOGIN SCREEN
   ========================================================================== */
.login-screen-bg {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 10% 20%, #031024 0%, #071f40 90%);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.login-card {
    width: 100%;
    max-width: 440px;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    padding: 2.75rem 2.25rem;
    position: relative;
    z-index: 2;
}

.login-brand-img {
    height: 52px;
    width: auto;
    object-fit: contain;
    margin-bottom: 0.75rem;
}

.login-field {
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 0.8rem 1rem;
    font-size: 0.92rem;
    transition: all 0.2s ease;
}

.login-field:focus {
    border-color: var(--adm-primary);
    box-shadow: 0 0 0 3.5px rgba(0, 102, 204, 0.15);
    outline: none;
}

/* RESPONSIVE */
@media (max-width: 991.98px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }

    .admin-sidebar.sidebar-open {
        transform: translateX(0);
    }

    .admin-main {
        margin-left: 0;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1030;
    }

    .sidebar-overlay.active {
        display: block;
    }
}
