/* ==========================================================================
   AURUM GOLD LOAN CRM — PURE CSS DESIGN SYSTEM (ZERO CDN / FRAMEWORK DEPENDENCY)
   Self-contained, ultra-fast, print-ready, responsive on 375px to 1440px+
   ========================================================================== */

:root {
    --gold-primary: #b8860b;
    --gold-dark: #8c6608;
    --gold-light: #fff8e7;
    --gold-border: #e6c875;
    --bg-body: #f4f6f9;
    --bg-card: #ffffff;
    --bg-sidebar: #1a202c;
    --bg-sidebar-hover: #2d3748;
    --text-main: #2d3748;
    --text-muted: #718096;
    --text-white: #ffffff;
    --border-color: #e2e8f0;
    --success: #28a745;
    --success-bg: #e8f5e9;
    --danger: #dc3545;
    --danger-bg: #ffebee;
    --warning: #d97706;
    --warning-bg: #fffbe6;
    --info: #0288d1;
    --info-bg: #e1f5fe;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    font-size: 14px;
    line-height: 1.5;
}

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

/* Sidebar */
.sidebar {
    width: 250px;
    background-color: var(--bg-sidebar);
    color: var(--text-white);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-badge {
    background: linear-gradient(135deg, #d4af37, #aa7c11);
    color: #fff;
    font-weight: bold;
    font-size: 14px;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

.brand-title {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #fff;
}

.brand-sub {
    font-size: 11px;
    color: var(--text-muted);
}

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

.sidebar-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #718096;
    padding: 14px 20px 6px;
    font-weight: 600;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: #cbd5e0;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    background-color: var(--bg-sidebar-hover);
    color: #fff;
    border-left-color: var(--gold-primary);
}

.sidebar-link.active {
    background-color: rgba(184, 134, 11, 0.15);
    color: #fff;
    border-left-color: var(--gold-primary);
    font-weight: 600;
}

/* Main Content Area */
.main-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Topbar */
.topbar {
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    padding: 12px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.user-avatar-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gold-light);
    color: var(--gold-dark);
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--gold-border);
}

.content-container {
    padding: 25px;
    flex-grow: 1;
}

/* Cards & Containers */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 15px;
}

.card-body {
    padding: 20px;
}

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

/* Typography & Utilities */
.text-muted { color: var(--text-muted) !important; }
.text-dark { color: #1a202c !important; }
.text-danger { color: var(--danger) !important; }
.text-success { color: var(--success) !important; }
.text-primary { color: #1e40af !important; }
.text-warning { color: #b45309 !important; }
.fw-bold { font-weight: 700 !important; }
.fw-semibold { font-weight: 600 !important; }
.fw-medium { font-weight: 500 !important; }
.text-center { text-align: center; }
.text-start { text-align: left; }
.text-end { text-align: right; }
.text-uppercase { text-transform: uppercase; }
.d-block { display: block; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }
.d-flex { display: flex; }
.flex-column { flex-direction: column; }
.flex-grow-1 { flex-grow: 1; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 16px; }
.gap-4 { gap: 24px; }
.justify-between, .justify-content-between { justify-content: space-between; }
.justify-center, .justify-content-center { justify-content: center; }
.align-center, .align-items-center { align-items: center; }
.align-items-start { align-items: flex-start; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 4px !important; }
.mb-2 { margin-bottom: 8px !important; }
.mb-3 { margin-bottom: 16px !important; }
.mb-4 { margin-bottom: 24px !important; }
.mt-1 { margin-top: 4px !important; }
.mt-2 { margin-top: 8px !important; }
.mt-3 { margin-top: 16px !important; }
.mt-4 { margin-top: 24px !important; }
.me-1 { margin-right: 4px; }
.me-2 { margin-right: 8px; }
.ms-1 { margin-left: 4px; }
.ms-2 { margin-left: 8px; }
.p-0 { padding: 0 !important; }
.p-1 { padding: 4px !important; }
.p-2 { padding: 8px !important; }
.p-3 { padding: 16px !important; }
.p-4 { padding: 24px !important; }
.pb-2 { padding-bottom: 8px !important; }
.pb-3 { padding-bottom: 16px !important; }
.pt-2 { padding-top: 8px !important; }
.pt-3 { padding-top: 16px !important; }
.pt-4 { padding-top: 24px !important; }
.border { border: 1px solid var(--border-color) !important; }
.border-top { border-top: 1px solid var(--border-color) !important; }
.border-bottom { border-bottom: 1px solid var(--border-color) !important; }
.border-0 { border: 0 !important; }
.rounded-circle { border-radius: 50% !important; }
.rounded { border-radius: var(--radius-sm) !important; }
.rounded-3 { border-radius: var(--radius-md) !important; }
.bg-white { background-color: #ffffff !important; }
.bg-light { background-color: #f8fafc !important; }
.bg-dark { background-color: #1a202c !important; }
.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.position-relative { position: relative; }
.overflow-hidden { overflow: hidden; }
.mx-auto { margin-left: auto; margin-right: auto; }
.w-100 { width: 100% !important; }
.h-100 { height: 100% !important; }
.container-fluid { width: 100%; }

/* Grid System */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-left: -8px;
    margin-right: -8px;
}

.g-2 { margin-left: -4px; margin-right: -4px; }
.g-2 > [class*="col"] { padding-left: 4px; padding-right: 4px; margin-bottom: 8px; }
.g-3 { margin-left: -8px; margin-right: -8px; }
.g-3 > [class*="col"] { padding-left: 8px; padding-right: 8px; margin-bottom: 16px; }
.g-4 { margin-left: -12px; margin-right: -12px; }
.g-4 > [class*="col"] { padding-left: 12px; padding-right: 12px; margin-bottom: 20px; }

.col-12 { flex: 0 0 100%; max-width: 100%; padding: 0 8px; }
.col-6 { flex: 0 0 50%; max-width: 50%; padding: 0 8px; }
.col-4 { flex: 0 0 33.333333%; max-width: 33.333333%; padding: 0 8px; }
.col-3 { flex: 0 0 25%; max-width: 25%; padding: 0 8px; }
.col-auto { flex: 0 0 auto; width: auto; padding: 0 8px; }

@media (min-width: 576px) {
    .col-sm-3 { flex: 0 0 25%; max-width: 25%; }
    .col-sm-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .col-sm-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
    .col-sm-6 { flex: 0 0 50%; max-width: 50%; }
}

@media (min-width: 768px) {
    .col-md-3 { flex: 0 0 25%; max-width: 25%; }
    .col-md-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .col-md-6 { flex: 0 0 50%; max-width: 50%; }
}

@media (min-width: 992px) {
    .col-lg-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .col-lg-5 { flex: 0 0 41.666667%; max-width: 41.666667%; }
    .col-lg-7 { flex: 0 0 58.333333%; max-width: 58.333333%; }
    .col-lg-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
}

@media (min-width: 1200px) {
    .col-xl-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .col-xl-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
}

@media (max-width: 768px) {
    .app-layout { flex-direction: column; }
    .sidebar { width: 100%; }
    .col-6:not(.g-2 > .col-6) { flex: 0 0 100%; max-width: 100%; }
    .col-4, .col-3 { flex: 0 0 100%; max-width: 100%; }
}

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

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 13px;
    color: #4a5568;
}

.form-control, .form-select {
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background-color: #fff;
    color: var(--text-main);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control-sm, .form-select-sm {
    padding: 5px 8px;
    font-size: 12px;
}

.form-control-lg {
    padding: 10px 14px;
    font-size: 16px;
}

.form-control:focus, .form-select:focus {
    outline: none;
    border-color: var(--gold-primary);
    box-shadow: 0 0 0 3px rgba(184, 134, 11, 0.15);
}

/* Input Groups */
.input-group {
    display: flex;
    width: 100%;
}

.input-group .input-group-text {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
    color: #4a5568;
    background-color: #f1f5f9;
    border: 1px solid var(--border-color);
    border-right: 0;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.input-group .form-control {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

/* Range Slider */
.form-range {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    outline: none;
    accent-color: var(--gold-primary);
    cursor: pointer;
}

/* Radio button pills for Karat selection */
.btn-check {
    position: absolute;
    clip: rect(0,0,0,0);
    pointer-events: none;
}

.btn-outline-warning {
    display: block;
    text-align: center;
    border: 1px solid #cbd5e0;
    background: #fff;
    color: #2d3748;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.15s;
}

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

.btn-check:checked + .btn-outline-warning {
    background: var(--gold-primary);
    color: #fff !important;
    border-color: var(--gold-primary);
    font-weight: 700;
}

/* Progress Bar */
.progress {
    display: flex;
    height: 8px;
    overflow: hidden;
    font-size: 10px;
    background-color: #e2e8f0;
    border-radius: 4px;
}

.progress-bar {
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    background-color: var(--gold-primary);
    transition: width 0.3s ease;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
    line-height: 1.4;
}

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

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

.btn-dark {
    background-color: #2d3748;
    color: #fff;
}
.btn-dark:hover { background-color: #1a202c; color: #fff; }

.btn-success {
    background-color: var(--success);
    color: #fff;
}
.btn-success:hover { background-color: #218838; color: #fff; }

.btn-outline-dark, .btn-outline-secondary {
    background: #fff;
    border-color: #cbd5e0;
    color: #4a5568;
}
.btn-outline-dark:hover, .btn-outline-secondary:hover { background: #f7fafc; border-color: #a0aec0; color: #1a202c; }

.btn-outline-danger {
    background: transparent;
    border-color: var(--danger);
    color: var(--danger);
}
.btn-outline-danger:hover { background: var(--danger); color: #fff; }

.btn-outline-primary {
    background: transparent;
    border-color: #2b6cb0;
    color: #2b6cb0;
}
.btn-outline-primary:hover { background: #2b6cb0; color: #fff; }

/* Tables */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

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

.table th {
    background-color: #f8fafc;
    color: #4a5568;
    font-weight: 600;
    text-align: left;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
}

.table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.table tbody tr:hover {
    background-color: #f8fafc;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    text-transform: capitalize;
}

.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-warning { background: var(--warning-bg); color: #b7791f; }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-dark { background: #edf2f7; color: #4a5568; border: 1px solid #cbd5e0; }

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 13px;
    border: 1px solid transparent;
}

.alert-success { background: var(--success-bg); color: var(--success); border-color: #c8e6c9; }
.alert-danger { background: var(--danger-bg); color: var(--danger); border-color: #ffcdd2; }
.alert-warning { background: var(--warning-bg); color: #8d5b0a; border-color: #ffe0b2; }

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1050;
    overflow-y: auto;
}

.modal.show, .modal:target {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-dialog {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 20px;
}

.modal-content {
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    overflow: hidden;
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.btn-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #a0aec0;
}

/* ==========================================================================
   PRINTABLE PAWN TICKET / PLEDGE AGREEMENT STYLES
   ========================================================================== */
.ticket-border {
    border: 2px solid #1a202c;
    padding: 24px;
    border-radius: 4px;
    max-width: 850px;
    margin: auto;
    background: #fff;
}

.header-title {
    font-size: 20px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #1a202c;
}

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

.table-ticket th, .table-ticket td {
    border: 1px solid #cbd5e0;
    padding: 6px 10px;
}

.table-ticket th {
    background-color: #f1f5f9;
    font-weight: 700;
}

@media print {
    body {
        background: #ffffff !important;
        padding: 0 !important;
        font-size: 11pt !important;
        color: #000000 !important;
    }
    .no-print, .sidebar, .topbar, header, footer {
        display: none !important;
    }
    .main-wrapper, .content-container, .app-layout {
        padding: 0 !important;
        margin: 0 !important;
        display: block !important;
    }
    .ticket-border {
        border: 1px solid #000000 !important;
        padding: 15px !important;
        max-width: 100% !important;
        box-shadow: none !important;
    }
    .table-ticket th, .table-ticket td {
        border: 1px solid #000000 !important;
    }
}
