:root {
    --primary: #00a8ff;
    --primary-dark: #0086cc;
    --secondary: #28a745;
    --danger: #ff4d4d;
    --warning: #ffc107;
    --info: #17a2b8;
    --dark: #050a12;
    --dark-light: #1a1f26;
    --text-main: #ffffff;
    --text-muted: #aeb9c7;
    --glass: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.1);
    --sidebar-width: 280px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--dark);
    color: var(--text-main);
    overflow-x: hidden;
    line-height: 1.6;
}

/* Scrollbar Modernization */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--dark);
}
::-webkit-scrollbar-thumb {
    background: var(--dark-light);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

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

/* Sidebar */
.modern-sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #0a111a 0%, #050a12 100%);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    padding: 40px 30px;
    text-align: center;
}

.sidebar-brand img {
    max-width: 150px;
    filter: drop-shadow(0 0 10px rgba(0, 168, 255, 0.3));
}

.sidebar-nav {
    flex-grow: 1;
    padding: 0 15px;
}

.nav-group {
    margin-bottom: 25px;
}

.nav-label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 1.5px;
    margin-bottom: 15px;
    padding-left: 15px;
    font-weight: 700;
}

.nav-item {
    list-style: none;
    margin-bottom: 5px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.nav-link i {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.nav-link:hover {
    background: rgba(0, 168, 255, 0.1);
    color: var(--primary);
}

.nav-link.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 168, 255, 0.3);
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--glass-border);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 40px;
    width: calc(100% - var(--sidebar-width));
}

.page-header {
    margin-bottom: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-title h1 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 5px;
}

.page-title p {
    color: var(--text-muted);
    font-size: 14px;
}

/* Cards */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.modern-card {
    background: var(--dark-light);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 25px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.modern-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.card-icon-box {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    font-size: 20px;
}

.icon-primary { background: rgba(0, 168, 255, 0.1); color: var(--primary); }
.icon-success { background: rgba(40, 167, 69, 0.1); color: var(--secondary); }
.icon-warning { background: rgba(255, 193, 7, 0.1); color: var(--warning); }
.icon-danger { background: rgba(255, 77, 77, 0.1); color: var(--danger); }

.stat-value {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Tables */
.table-container {
    background: var(--dark-light);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 20px;
    overflow-x: auto;
}

.modern-table {
    width: 100%;
    border-collapse: collapse;
}

.modern-table th {
    padding: 15px;
    text-align: left;
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--glass-border);
}

.modern-table td {
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    vertical-align: middle;
}

.modern-table tr:last-child td {
    border-bottom: none;
}

/* Badges */
.badge {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-pending { background: rgba(255, 193, 7, 0.1); color: var(--warning); }
.badge-progress { background: rgba(0, 168, 255, 0.1); color: var(--primary); }
.badge-success { background: rgba(40, 167, 69, 0.1); color: var(--secondary); }
.badge-danger { background: rgba(255, 77, 77, 0.1); color: var(--danger); }

/* Buttons */
.btn-modern {
    padding: 12px 24px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 168, 255, 0.3);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-main);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--text-muted);
}

.btn-icon {
    width: 35px;
    height: 35px;
    padding: 0;
    justify-content: center;
    border-radius: 8px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 12px 15px;
    color: #fff;
    outline: none;
    transition: all 0.3s ease;
    appearance: none;
}

select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='white'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 15px;
    padding-right: 40px;
}

.form-control option {
    background-color: #1a1f26;
    color: #fff;
}

.form-control:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 4px rgba(0, 168, 255, 0.1);
}


/* WhatsApp Floating Button */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #25d366;
    color: #fff;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    box-shadow: 0 5px 20px rgba(37, 211, 102, 0.4);
    z-index: 1000;
    transition: all 0.3s ease;
    text-decoration: none;
}

.whatsapp-float:hover {
    transform: scale(1.1) rotate(10deg);
}

/* Responsive */
@media (max-width: 992px) {
    .modern-sidebar {
        transform: translateX(-100%);
    }
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 20px;
    }
    .modern-sidebar.active {
        transform: translateX(0);
    }
}

/* Fix: Prevent horizontal scroll on tables */
.table-container {
    overflow-x: hidden;
}
.modern-table {
    table-layout: fixed;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.modern-table th,
.modern-table td {
    white-space: normal;
    word-break: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 12px 10px;
    font-size: 13px;
}
.modern-table th:first-child,
.modern-table td:first-child {
    width: 30%;
}
.main-content {
    overflow-x: hidden;
    max-width: 100%;
}
.page-header {
    flex-wrap: wrap;
    gap: 15px;
}
@media (max-width: 1400px) {
    .modern-table th,
    .modern-table td {
        padding: 10px 8px;
        font-size: 12px;
    }
}
