/* ============================================
   Apotek Sumakul - Custom Stylesheet
   Tema: Hijau Solid - Apotek Clean
   ============================================ */

:root {
    --primary: #2a7d5f;
    --primary-dark: #1e5c45;
    --primary-light: #d4edda;
    --primary-soft: #edf5f0;
    --secondary: #37474f;
    --accent: #5cb85c;
    --sidebar-bg: #1e3a2f;
    --sidebar-hover: #27503f;
    --sidebar-active: #2a7d5f;
    --body-bg: #f3f6f4;
    --card-shadow: 0 1px 6px rgba(0,0,0,0.06);
    --text-dark: #2c3e36;
    --text-muted: #7a8e84;
    --border-color: #d5e3da;
    --white: #ffffff;
    --danger: #d9534f;
    --warning: #e8a317;
    --info: #3498db;
    --success: #2a7d5f;
}

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

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--body-bg);
    color: var(--text-dark);
    font-size: 14px;
    line-height: 1.6;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    background: var(--sidebar-bg);
    z-index: 1000;
    overflow-y: auto;
    transition: all 0.3s ease;
}

.sidebar-brand {
    padding: 22px 20px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    text-align: center;
}

.sidebar-brand h4 {
    color: var(--white);
    font-weight: 700;
    font-size: 17px;
    margin: 0;
    letter-spacing: 0.3px;
}

.sidebar-brand small {
    color: rgba(255,255,255,0.45);
    font-size: 11px;
    display: block;
    margin-top: 3px;
}

.sidebar-menu {
    list-style: none;
    padding: 10px 0;
    margin: 0;
}

.sidebar-menu .menu-header {
    color: rgba(255,255,255,0.3);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    padding: 18px 20px 6px;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    font-size: 13px;
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
}

.sidebar-menu li a:hover {
    background: var(--sidebar-hover);
    color: var(--white);
    border-left-color: var(--accent);
}

.sidebar-menu li a.active {
    background: var(--sidebar-active);
    color: var(--white);
    border-left-color: var(--accent);
    font-weight: 500;
}

.sidebar-menu li a i {
    width: 20px;
    margin-right: 12px;
    text-align: center;
    font-size: 14px;
}

.sidebar-menu .badge {
    margin-left: auto;
    font-size: 10px;
    padding: 3px 7px;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    margin-left: 260px;
    min-height: 100vh;
    transition: all 0.3s ease;
}

/* ============================================
   TOPBAR / NAVBAR
   ============================================ */
.topbar {
    background: var(--white);
    padding: 0 25px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 999;
}

.topbar .page-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-right .notif-btn {
    position: relative;
    background: none;
    border: none;
    padding: 8px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 17px;
    border-radius: 6px;
    transition: all 0.15s;
}

.topbar-right .notif-btn:hover {
    background: var(--primary-soft);
    color: var(--primary);
}

.topbar-right .notif-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--danger);
    color: white;
    font-size: 9px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-dropdown .btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 13px;
    background: var(--primary-soft);
    border: 1px solid var(--border-color);
    color: var(--primary-dark);
}

.user-dropdown .btn:hover {
    background: var(--primary-light);
}

.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
}

/* ============================================
   CONTENT WRAPPER
   ============================================ */
.content-wrapper {
    padding: 24px;
}

/* ============================================
   CARDS
   ============================================ */
.card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--card-shadow);
    background: var(--white);
    margin-bottom: 20px;
}

.card-header {
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
    padding: 14px 20px;
    border-radius: 8px 8px 0 0 !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h5 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
}

.card-body {
    padding: 20px;
}

/* ============================================
   STAT CARDS (Dashboard)
   ============================================ */
.stat-card {
    border-radius: 8px;
    padding: 18px 20px;
    color: var(--white);
    position: relative;
    overflow: hidden;
}

.stat-card .stat-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 38px;
    opacity: 0.18;
}

.stat-card .stat-value {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 2px;
}

.stat-card .stat-label {
    font-size: 12px;
    opacity: 0.85;
    font-weight: 500;
}

.stat-card.bg-hijau {
    background: #2a7d5f;
}

.stat-card.bg-biru {
    background: #2980b9;
}

.stat-card.bg-kuning {
    background: #d4a017;
}

.stat-card.bg-merah {
    background: #c0392b;
}

.stat-card.bg-teal {
    background: #1a8a7d;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    border-radius: 6px;
    font-weight: 500;
    font-size: 13px;
    padding: 7px 15px;
    transition: all 0.15s;
}

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

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

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

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

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

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

.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 5px;
}

/* ============================================
   TABLES
   ============================================ */
.table {
    font-size: 13px;
}

.table thead th {
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border: none;
    padding: 11px 14px;
    white-space: nowrap;
}

.table tbody td {
    padding: 9px 14px;
    vertical-align: middle;
    border-color: #eef2ef;
}

.table tbody tr:hover {
    background: #f7faf8;
}

/* ============================================
   FORMS
   ============================================ */
.form-control, .form-select {
    border-radius: 6px;
    border: 1px solid #c8d6ce;
    padding: 8px 12px;
    font-size: 13px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(42, 125, 95, 0.12);
}

.form-label {
    font-weight: 500;
    font-size: 13px;
    color: var(--text-dark);
    margin-bottom: 4px;
}

/* ============================================
   BADGES
   ============================================ */
.badge-aktif {
    background: #d4edda;
    color: #1e5c45;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.badge-nonaktif {
    background: #f8d7da;
    color: #842029;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.badge-pending {
    background: #fff3cd;
    color: #856404;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.badge-disetujui {
    background: #d4edda;
    color: #1e5c45;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.badge-ditolak {
    background: #f8d7da;
    color: #842029;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2a7d5f;
}

.login-card {
    width: 400px;
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    overflow: hidden;
}

.login-card .login-header {
    background: var(--sidebar-bg);
    padding: 28px 30px;
    text-align: center;
    color: var(--white);
}

.login-card .login-header h3 {
    font-weight: 700;
    margin-bottom: 4px;
    font-size: 20px;
}

.login-card .login-header p {
    opacity: 0.7;
    font-size: 12px;
    margin: 0;
}

.login-card .login-body {
    padding: 28px 30px;
}

.login-card .login-body .form-control {
    padding: 9px 12px;
    border-radius: 6px;
}

.login-card .login-body .btn-login {
    width: 100%;
    padding: 10px;
    background: var(--primary);
    border: none;
    border-radius: 6px;
    color: white;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s;
}

.login-card .login-body .btn-login:hover {
    background: var(--primary-dark);
}

/* ============================================
   MODAL
   ============================================ */
.modal-content {
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.modal-header {
    background: var(--primary-soft);
    border-bottom: 1px solid var(--border-color);
    border-radius: 8px 8px 0 0;
    padding: 14px 20px;
}

.modal-header .modal-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-dark);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 12px 20px;
}

/* ============================================
   ALERT
   ============================================ */
.alert {
    border-radius: 6px;
    border: none;
    font-size: 13px;
    padding: 11px 15px;
}

/* ============================================
   POS LAYOUT
   ============================================ */
.pos-container {
    display: flex;
    gap: 20px;
    min-height: calc(100vh - 110px);
}

.pos-products {
    flex: 1;
}

.pos-cart {
    width: 380px;
    background: var(--white);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
}

.pos-cart-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 14px;
    color: var(--primary-dark);
}

.pos-cart-body {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.pos-cart-footer {
    border-top: 2px solid var(--border-color);
    padding: 15px 20px;
}

.pos-item {
    display: flex;
    align-items: center;
    padding: 9px 10px;
    border-bottom: 1px solid #eef2ef;
    gap: 10px;
}

.pos-item .item-name {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
}

.pos-item .item-price {
    font-size: 13px;
    color: var(--primary);
    font-weight: 600;
    min-width: 90px;
    text-align: right;
}

.pos-item .item-qty {
    width: 50px;
    text-align: center;
    border: 1px solid #c8d6ce;
    border-radius: 4px;
    padding: 4px;
    font-size: 13px;
}

.pos-total-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 13px;
}

.pos-total-row.grand-total {
    font-size: 17px;
    font-weight: 700;
    color: var(--primary-dark);
    border-top: 2px solid var(--border-color);
    padding-top: 10px;
    margin-top: 5px;
}

/* ============================================
   STRUK / RECEIPT
   ============================================ */
@media print {
    .sidebar, .topbar, .no-print {
        display: none !important;
    }
    .main-content {
        margin-left: 0 !important;
    }
    .content-wrapper {
        padding: 0 !important;
    }
}

.struk {
    width: 300px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    margin: 0 auto;
    padding: 15px;
}

.struk .struk-header {
    text-align: center;
    border-bottom: 1px dashed #333;
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.struk .struk-item {
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
}

.struk .struk-footer {
    border-top: 1px dashed #333;
    padding-top: 10px;
    margin-top: 10px;
    text-align: center;
    font-size: 11px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-dark);
    cursor: pointer;
    padding: 5px;
}

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .sidebar-toggle {
        display: block;
    }
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.4);
        z-index: 999;
    }
    .sidebar-overlay.show {
        display: block;
    }
    .pos-container {
        flex-direction: column;
    }
    .pos-cart {
        width: 100%;
    }
}

/* ============================================
   SCROLLBAR
   ============================================ */
.sidebar::-webkit-scrollbar {
    width: 4px;
}

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

/* ============================================
   MISC
   ============================================ */
.text-primary {
    color: var(--primary) !important;
}

.bg-primary {
    background-color: var(--primary) !important;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 44px;
    margin-bottom: 12px;
    color: #b8d4c6;
}

.empty-state p {
    font-size: 13px;
    margin: 0;
}

.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    border: 1px solid #c8d6ce;
    border-radius: 5px;
    padding: 5px 10px;
    font-size: 13px;
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(42, 125, 95, 0.12);
}

.page-item.active .page-link {
    background-color: var(--primary);
    border-color: var(--primary);
}

.page-link {
    color: var(--primary);
}

.page-link:hover {
    color: var(--primary-dark);
}
