/* ============================================
   DAYEUHKOLOT POS - Global Styles
   ============================================ */

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

body {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    background: #FFFFFF;
    color: #2C3947;
}

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

/* Loading Spinner */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.loader-container {
    text-align: center;
    background: #fff;
    padding: 32px 48px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid #E8EDF2;
}

.loader-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid #E8EDF2;
    border-top: 3px solid #2C3947;
    border-right: 3px solid #547A95;
    border-radius: 50%;
    animation: loader-spin 0.8s linear infinite;
    margin: 0 auto 16px auto;
}

@keyframes loader-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loader-text {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #547A95;
    letter-spacing: 0.5px;
}

.loader-progress-bar {
    width: 250px;
    height: 4px;
    background: #E8EDF2;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 16px;
}

.loader-progress-fill {
    width: 0%;
    height: 100%;
    background: #2C3947;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.loader-hidden {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: #FFFFFF;
    border-right: 1px solid #547A95;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    height: 100vh;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    overflow-y: auto;
}

.sidebar.open {
    transform: translateX(0);
}

@media (min-width: 768px) {
    .sidebar {
        position: relative;
        transform: translateX(0);
    }
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #E8EDF2;
}

.sidebar-logo {
    font-weight: 600;
    font-size: 18px;
    color: #2C3947;
}

.sidebar-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: #2C3947;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 400;
    margin-bottom: 4px;
}

.nav-item i {
    width: 18px;
    height: 18px;
}

.nav-item:hover {
    background: #E8EDF2;
}

.nav-item.active {
    background: #E8EDF2;
    font-weight: 600;
}

.nav-divider {
    height: 1px;
    background: #E8EDF2;
    margin: 12px 0;
}

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

.nav-group-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
}

.nav-group-header i:first-child {
    width: 18px;
    height: 18px;
}

.nav-group-header .chevron {
    width: 14px;
    height: 14px;
    margin-left: auto;
    transition: transform 0.2s;
}

.nav-group-header.open .chevron {
    transform: rotate(180deg);
}

.nav-group-items {
    display: none;
    padding-left: 38px;
    margin-top: 4px;
}

.nav-group-items.open {
    display: block;
}

.nav-subitem {
    display: block;
    padding: 8px 12px;
    font-size: 13px;
    color: #2C3947;
    text-decoration: none;
    border-radius: 4px;
}

.nav-subitem:hover {
    background: #E8EDF2;
}

/* Sidebar Overlay (Mobile) */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 99;
    display: none;
}

.sidebar-overlay.active {
    display: block;
}

@media (min-width: 768px) {
    .sidebar-overlay {
        display: none !important;
    }
}

/* Main Content */
.main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: #FFFFFF;
}

/* Header */
.header {
    background: #FFFFFF;
    border-bottom: 1px solid #E8EDF2;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.hamburger i {
    width: 20px;
    height: 20px;
    color: #2C3947;
}

@media (max-width: 767px) {
    .hamburger {
        display: block;
    }
}

.header-title {
    font-size: 18px;
    font-weight: 600;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-name {
    font-size: 13px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: #E8EDF2;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-avatar i {
    width: 16px;
    height: 16px;
    color: #2C3947;
}

/* Content */
.content {
    padding: 24px;
    flex: 1;
    background: #FFFFFF;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header h1 {
    font-size: 24px;
    font-weight: 600;
}

/* Cards */
.card {
    background: #FFFFFF;
    border: 1px solid #E8EDF2;
    border-radius: 4px;
    padding: 16px;
}

.card-header {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #E8EDF2;
}

.card-title {
    font-size: 13px;
    font-weight: 400;
    color: #547A95;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 28px;
    font-weight: 600;
}

/* Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.two-col {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (max-width: 767px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .two-col {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

/* ============================================
   BUTTONS - SEMUA PUNYA BORDER
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 4px;
    border: 1px solid #547A95;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s ease;
    background: #FFFFFF;
    color: #2C3947;
}

.btn:hover {
    background: #447D9B;
    border-color: #447D9B;
    color: #FFFFFF;
}

.btn-primary {
    background: #2C3947;
    border-color: #2C3947;
    color: #FFFFFF;
}

.btn-primary:hover {
    background: #447D9B;
    border-color: #447D9B;
    color: #FFFFFF;
}

.btn-danger {
    background: #AE2448;
    border-color: #AE2448;
    color: #FFFFFF;
}

.btn-danger:hover {
    background: #447D9B;
    border-color: #447D9B;
    color: #FFFFFF;
}

.btn-secondary {
    background: #FFFFFF;
    border-color: #547A95;
    color: #2C3947;
}

.btn-secondary:hover {
    background: #447D9B;
    border-color: #447D9B;
    color: #FFFFFF;
}

.btn-small {
    padding: 4px 12px;
    font-size: 12px;
}

.btn-medium {
    padding: 8px 16px;
    font-size: 14px;
}

.btn-large {
    padding: 12px 24px;
    font-size: 16px;
}

.btn-full {
    width: 100%;
}

/* Button Group */
.button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.button-group > .btn {
    flex: 1 1 calc(50% - 8px);
    min-width: 0;
}

.button-group > .btn:only-child {
    flex: 1 1 100%;
}

@media (min-width: 768px) {
    .button-group > .btn {
        flex: 0 1 auto;
    }
}

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

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
    color: #2C3947;
}

.form-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #E8EDF2;
    border-radius: 4px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    background: #FFFFFF;
}

.form-input:focus {
    outline: none;
    border-color: #547A95;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (max-width: 767px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

/* Search Bar */
.search-bar {
    margin-bottom: 20px;
}

.search-bar input {
    width: 100%;
    max-width: 400px;
    padding: 8px 12px;
    border: 1px solid #E8EDF2;
    border-radius: 4px;
    font-size: 14px;
    background: #FFFFFF;
}

/* Table */
.table-container {
    overflow-x: auto;
    background: #FFFFFF;
    border: 1px solid #547A95;
    border-radius: 4px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.table th {
    text-align: left;
    padding: 12px;
    background: #E8EDF2;
    font-weight: 600;
    border-bottom: 1px solid #547A95;
    color: #2C3947;
}

.table td {
    padding: 10px 12px;
    border-bottom: 1px solid #E8EDF2;
    color: #2C3947;
    background: #FFFFFF;
}

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

.table tr:hover td {
    background: #E8EDF2;
}

/* Badge */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.badge-success {
    background: #E8EDF2;
    color: #2C3947;
}

.badge-danger {
    background: #AE2448;
    color: #FFFFFF;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: #FFFFFF;
    border-radius: 4px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid #E8EDF2;
}

.modal-header {
    padding: 16px;
    border-bottom: 1px solid #E8EDF2;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.modal-close i {
    width: 18px;
    height: 18px;
    color: #2C3947;
}

.modal-body {
    padding: 16px;
    flex: 1;
    overflow-y: auto;
}

.modal-footer {
    padding: 16px;
    border-top: 1px solid #E8EDF2;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 20px;
}

.page-info {
    font-size: 13px;
    color: #547A95;
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 10px 16px;
    border-radius: 4px;
    font-size: 13px;
    animation: slideIn 0.2s ease;
}

.toast-success {
    background: #2C3947;
    color: #FFFFFF;
}

.toast-error {
    background: #AE2448;
    color: #FFFFFF;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: #547A95;
}

/* Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.hidden { display: none; }

/* Page transition */
.main-content {
    opacity: 1;
    transition: opacity 0.2s ease;
}

/* Smooth appearance for content */
.content {
    animation: contentFadeIn 0.3s ease-out;
}

@keyframes contentFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}