/**
 * MikroTik Monitor & Manager - Custom Styles
 * Clean, Dark/Light Professional Dashboard UI
 */

:root {
    --sidebar-width: 250px;
    --sidebar-bg: #0f172a;
    --sidebar-hover: #1e293b;
    --sidebar-active: #3b82f6;
    --sidebar-text: #94a3b8;
    --sidebar-text-active: #ffffff;
    --topbar-height: 62px;
    --body-bg: #f8fafc;
    --card-border: #e2e8f0;
}

body {
    background-color: var(--body-bg);
    color: #334155;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Sidebar Styles */
#sidebar-wrapper {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    height: 100vh;
    max-height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1020;
    transition: all 0.25s ease-in-out;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}

.sidebar-heading {
    height: var(--topbar-height);
    min-height: var(--topbar-height);
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.sidebar-brand-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.35);
}

.sidebar-nav {
    padding: 0.75rem 0.65rem 1.5rem 0.65rem;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

/* Custom Sleek Scrollbar untuk Navigasi Sidebar */
.sidebar-nav::-webkit-scrollbar {
    width: 5px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

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

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.35);
}

.sidebar-category {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #64748b;
    padding: 0.75rem 0.75rem 0.35rem;
    margin-top: 0.25rem;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    padding: 0.55rem 0.75rem;
    color: var(--sidebar-text);
    font-size: 0.88rem;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.18s ease-in-out;
    margin-bottom: 2px;
}

.sidebar-nav .nav-link i {
    font-size: 1.1rem;
    margin-right: 0.75rem;
    width: 22px;
    text-align: center;
    opacity: 0.85;
}

.sidebar-nav .nav-link:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.07);
    transform: translateX(3px);
}

.sidebar-nav .nav-link:hover i {
    opacity: 1;
}

.sidebar-nav .nav-link.active {
    color: #ffffff;
    background-color: #3b82f6;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

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

/* Footer status sidebar */
.sidebar-footer {
    padding: 0.85rem 1.25rem;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-indicator.online {
    background-color: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

.status-indicator.offline {
    background-color: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}

/* Content Wrapper */
#content-wrapper {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    transition: all 0.25s ease-in-out;
}

/* Top Navbar */
.top-navbar {
    height: var(--topbar-height);
    background: #ffffff;
    border-bottom: 1px solid var(--card-border);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1010;
}

/* Cards & Widgets */
.stat-card {
    border: 1px solid var(--card-border);
    border-radius: 0.75rem;
    background: #ffffff;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    height: 100%;
}

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

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

.bg-primary-soft { background-color: rgba(59, 130, 246, 0.1); color: #2563eb; }
.bg-success-soft { background-color: rgba(16, 185, 129, 0.1); color: #059669; }
.bg-warning-soft { background-color: rgba(245, 158, 11, 0.1); color: #d97706; }
.bg-danger-soft  { background-color: rgba(239, 68, 68, 0.1); color: #dc2626; }
.bg-info-soft    { background-color: rgba(14, 165, 233, 0.1); color: #0284c7; }
.bg-purple-soft  { background-color: rgba(168, 85, 247, 0.1); color: #9333ea; }

/* Status Badges */
.badge-status-online {
    background-color: #10b981;
    color: white;
}

.badge-status-offline {
    background-color: #ef4444;
    color: white;
}

.badge-status-isolated {
    background-color: #dc2626;
    color: white;
    animation: pulse-danger 2s infinite;
}

@keyframes pulse-danger {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* Data Tables */
.card-table {
    border: 1px solid var(--card-border);
    border-radius: 0.75rem;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    overflow: hidden;
}

.card-table .card-header {
    background-color: #ffffff;
    border-bottom: 1px solid var(--card-border);
    padding: 1rem 1.25rem;
}

.table > :not(caption) > * > * {
    padding: 0.75rem 1rem;
    vertical-align: middle;
}

.table thead th {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    background-color: #f8fafc;
    border-bottom: 1px solid var(--card-border);
}

/* Voucher Print Styles */
@media print {
    #sidebar-wrapper, .top-navbar, .no-print, .btn, .breadcrumb {
        display: none !important;
    }
    #content-wrapper {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    body {
        background-color: #fff !important;
    }
    .voucher-card {
        page-break-inside: avoid;
    }
}

.voucher-card {
    border: 1.5px dashed #94a3b8;
    border-radius: 8px;
    padding: 10px 12px;
    background: #fff;
    margin-bottom: 15px;
    position: relative;
}

.voucher-brand {
    font-size: 0.85rem;
    font-weight: 700;
    color: #0f172a;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 4px;
    margin-bottom: 8px;
}

.voucher-code {
    font-family: "Courier New", Courier, monospace;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: #1e293b;
    background: #f1f5f9;
    padding: 4px 6px;
    border-radius: 4px;
    text-align: center;
}

/* Responsive adjustment */
@media (max-width: 991.98px) {
    #sidebar-wrapper {
        margin-left: calc(-1 * var(--sidebar-width));
    }
    #sidebar-wrapper.show {
        margin-left: 0;
    }
    #content-wrapper {
        margin-left: 0;
    }
}

/* Explicit High-Contrast Form Switches & Checkboxes */
.form-check-input {
    cursor: pointer;
    min-width: 1.2rem;
    min-height: 1.2rem;
    border: 2px solid #94a3b8 !important;
}

.form-check-input:checked {
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
}

.form-switch .form-check-input {
    min-width: 2.75rem !important;
    min-height: 1.5rem !important;
    margin-left: -3rem !important;
    border-radius: 2rem !important;
}

.form-switch {
    padding-left: 3.25rem !important;
}
