/* ==========================================================================
   RO Service Pro - Modern Clean SaaS Theme
   ========================================================================== */

:root {
    --primary: #4361ee;
    --primary-hover: #3751d6;
    --secondary: #3f37c9;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;
    --dark: #0f172a;
    --sidebar-bg: #1e2238;
    --light: #f8fafc;
    --border-color: #e2e8f0;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --sidebar-width: 250px;
    --header-height: 60px;
    --bottom-nav-height: 60px;
}

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #f8fafc;
    color: var(--text-main);
    font-size: 0.875rem;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   Sidebar & Layout (App)
   ========================================================================== */

.app-body {
    overflow-x: hidden;
}

.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background-color: var(--sidebar-bg);
    z-index: 1040;
    transition: transform 0.25s ease-in-out;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-header h4 {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 0.6rem;
}

.sidebar-menu::-webkit-scrollbar {
    width: 4px;
}

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

.sidebar .nav-item {
    margin-bottom: 2px;
}

.sidebar .nav-link {
    color: #94a3b8;
    padding: 0.55rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.15s ease;
}

.sidebar .nav-link i {
    font-size: 1.05rem;
    width: 20px;
    text-align: center;
    color: #64748b;
    transition: color 0.15s;
}

.sidebar .nav-link:hover {
    color: #f1f5f9;
    background-color: rgba(255, 255, 255, 0.06);
}

.sidebar .nav-link:hover i {
    color: #f1f5f9;
}

.sidebar .nav-link.active {
    color: #ffffff;
    background-color: var(--primary);
    font-weight: 600;
}

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

.sidebar .nav-title {
    font-size: 0.68rem;
    letter-spacing: 0.6px;
    color: #64748b;
    margin-top: 1rem !important;
    margin-bottom: 0.35rem !important;
}

/* Main Wrapper */
.main-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Top Navbar */
.top-navbar {
    height: var(--header-height);
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.search-bar {
    width: 280px;
}

.search-bar .form-control {
    background-color: #f1f5f9;
    border-color: transparent;
    font-size: 0.85rem;
    padding: 0.45rem 0.85rem;
}

.search-bar .form-control:focus {
    background-color: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.15);
}

.search-bar .input-group-text {
    background-color: #f1f5f9;
    border-color: transparent;
    color: var(--text-muted);
}

/* ==========================================================================
   Stat Cards & Grid Styling
   ========================================================================== */

.stat-card {
    background: #ffffff;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04) !important;
    transition: all 0.2s ease;
}

.stat-card:hover {
    box-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.08) !important;
    transform: translateY(-2px);
}

.stat-card .card-body {
    padding: 1.15rem 1.25rem !important;
}

.stat-card h6 {
    font-size: 0.8rem !important;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-muted) !important;
    font-weight: 600 !important;
}

.stat-card h3 {
    font-size: 1.6rem !important;
    font-weight: 700 !important;
    letter-spacing: -0.5px;
    color: var(--text-main);
    line-height: 1.2;
}

.stat-card .icon-shape {
    width: 38px !important;
    height: 38px !important;
    border-radius: 10px !important;
}

.stat-card .icon-shape i {
    font-size: 1.15rem !important;
}

/* Regular Cards */
.card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.03);
    margin-bottom: 1.25rem;
}

.card-header {
    background-color: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.9rem 1.25rem;
    font-weight: 600;
    font-size: 0.925rem;
}

.card-body {
    padding: 1.25rem;
}

/* Buttons */
.btn {
    border-radius: 7px;
    font-weight: 500;
    font-size: 0.85rem;
    padding: 0.42rem 0.95rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    transition: all 0.15s ease-in-out;
}

.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

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

.btn-sm {
    font-size: 0.78rem;
    padding: 0.28rem 0.65rem;
    border-radius: 6px;
}

.btn-lg {
    font-size: 0.95rem;
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
}

/* Forms */
.form-control, .form-select {
    border-radius: 7px;
    font-size: 0.85rem;
    padding: 0.45rem 0.8rem;
    border-color: #cbd5e1;
    color: var(--text-main);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.15);
}

.form-label {
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: #334155;
}

/* Tables */
.table {
    font-size: 0.85rem;
    margin-bottom: 0;
}

.table th {
    background-color: #f8fafc;
    color: #475569;
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.65rem 0.9rem;
}

.table td {
    padding: 0.75rem 0.9rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

/* Mobile Bottom Navigation */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--bottom-nav-height);
    background-color: #ffffff;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.06);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1030;
    padding-bottom: env(safe-area-inset-bottom);
    border-top: 1px solid #e2e8f0;
}

.mobile-bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #64748b;
    text-decoration: none;
    font-size: 0.72rem;
    width: 20%;
    height: 100%;
}

.mobile-bottom-nav .nav-item i {
    font-size: 1.25rem;
    margin-bottom: 1px;
}

.mobile-bottom-nav .nav-item.active {
    color: var(--primary);
    font-weight: 600;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .main-wrapper {
        margin-left: 0;
    }
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0,0,0,0.4);
        z-index: 1035;
        display: none;
    }
    .sidebar-overlay.show {
        display: block;
    }
    .content {
        padding-bottom: 75px !important;
    }
}
