/* =============================================================
   surya_app — Custom Styles (Bootstrap 5 overrides)
   ============================================================= */

/* btn-xs — extra-small button (Bootstrap 5 removed this) */
.btn.btn-xs {
    padding: 0.15rem 0.4rem;
    font-size: 0.75rem;
    line-height: 1.5;
    border-radius: 0.2rem;
}

:root {
    --sidebar-width:      250px;
    --sidebar-mini-width: 64px;
    --sidebar-bg:    #1e2a38;
    --sidebar-hover: #2c3e50;
    --sidebar-active:#3498db;   
    --topbar-height: 56px;
}

/* ── Layout ─────────────────────────────────────────────── */
body {
    background-color: #f4f6f9;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.wrapper {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────── */
#sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    min-height: 100vh;
    flex-shrink: 0;
    transition: width 0.25s ease;
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    z-index: 1000;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Minimized sidebar */
body.sidebar-mini #sidebar {
    width: var(--sidebar-mini-width);
}
body.sidebar-mini #main-content {
    margin-left: var(--sidebar-mini-width);
}
body.sidebar-mini #sidebar .nav-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
    white-space: nowrap;
    display: inline-block;
    transition: opacity 0.2s ease, width 0.25s ease;
}
body.sidebar-mini #sidebar .nav-label {
    opacity: 0;
    height: 0;
    padding: 0;
    overflow: hidden;
    transition: all 0.2s ease;
}
body.sidebar-mini #sidebar .sidebar-brand .nav-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
}
body.sidebar-mini #sidebar .sidebar-brand {
    justify-content: center;
    padding: 1rem 0;
}
body.sidebar-mini #sidebar .nav-link {
    justify-content: center;
    padding: 0.75rem 0;
}

#sidebar .nav-text {
    opacity: 1;
    transition: opacity 0.2s ease, width 0.25s ease;
    white-space: nowrap;
    display: inline-block;
}

#sidebar .sidebar-brand {
    padding: 1rem 1.25rem;
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 700;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: padding 0.25s ease, justify-content 0.25s ease;
}

#sidebar .sidebar-brand span {
    color: var(--sidebar-active);
}

#sidebar .nav-label {
    color: rgba(255,255,255,0.4);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 1rem 1.25rem 0.25rem;
    transition: all 0.2s ease;
    overflow: hidden;
    white-space: nowrap;
}

#sidebar .nav-link {
    color: rgba(255,255,255,0.75);
    padding: 0.6rem 1.25rem;
    border-radius: 0;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.9rem;
    transition: background 0.15s, color 0.15s, padding 0.25s, justify-content 0.25s;
}

#sidebar .nav-link:hover {
    background: var(--sidebar-hover);
    color: #ffffff;
}

#sidebar .nav-link.active {
    background: var(--sidebar-active);
    color: #ffffff;
}

#sidebar .nav-link i {
    width: 18px;
    text-align: center;
    flex-shrink: 0;
}

/* ── Main content ─────────────────────────────────────────── */
#main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    transition: margin-left 0.25s ease;
}

.topbar {
    height: var(--topbar-height);
    background: #ffffff;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: relative;
    top: 0;
    z-index: 999;
}

.page-body {
    padding: 1.5rem;
    flex: 1;
}

/* ── Cards ──────────────────────────────────────────────── */
.card {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.card-header {
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    font-weight: 600;
    padding: 1rem 1.25rem;
}

/* ── Tables ─────────────────────────────────────────────── */
.table thead th {
    background: #f8f9fa;
    color: #000;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #dee2e6;
}


/* ── Badge roles ─────────────────────────────────────────── */
.badge-super_admin { background-color: #6f42c1; }
.badge-admin       { background-color: #0d6efd; }
.badge-finance     { background-color: #198754; }
.badge-owner       { background-color: #fd7e14; }

/* ── Login page ─────────────────────────────────────────── */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e2a38 0%, #2c3e50 100%);
}

.login-card {
    width: 100%;
    max-width: 400px;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}

.login-card .card-header {
    background: var(--sidebar-active);
    color: #fff;
    text-align: center;
    padding: 1.5rem;
    border-bottom: none;
}

/* ── Stat cards ─────────────────────────────────────────── */
.stat-card {
    border-left: 4px solid;
    border-radius: 0.4rem;
}
.stat-card.primary  { border-color: #0d6efd; }
.stat-card.success  { border-color: #198754; }
.stat-card.warning  { border-color: #ffc107; }
.stat-card.danger   { border-color: #dc3545; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
    body:not(.sidebar-mini) #sidebar { width: var(--sidebar-width); }
    body.sidebar-mini #sidebar       { width: 0; overflow: hidden; }
    body.sidebar-mini #main-content  { margin-left: 0; }
    #main-content                    { margin-left: 0 !important; }
    #sidebar { position: fixed; }
}


/* #### Custom Overrides #### */
.mt-min5 {
    margin-top: -5px !important;
}