/* ==========================================================================
   Aplikasi Persediaan Obat - Modern Medical Aesthetic
   Instalasi Farmasi Kota Gorontalo
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #0d9488;          /* Emerald / Teal */
    --primary-hover: #0f766e;
    --primary-light: #ccfbf1;
    --primary-dark: #115e59;
    --secondary: #64748b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #0284c7;
    --dark: #0f172a;
    --light: #f8fafc;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --sidebar-width: 260px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

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

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #f1f5f9;
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Layout Wrapper */
.app-wrapper {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* Sidebar Styles */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #042f2e 0%, #0f172a 100%);
    color: #fff;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.sidebar-brand {
    padding: 1.5rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #14b8a6, #0d9488);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    color: #fff;
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.4);
}

.sidebar-brand-text h5 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    color: #fff;
    letter-spacing: -0.2px;
}

.sidebar-brand-text small {
    font-size: 0.75rem;
    color: #94a3b8;
    display: block;
}

.sidebar-menu {
    list-style: none;
    padding: 1.25rem 0.85rem;
    flex-grow: 1;
    overflow-y: auto;
}

.sidebar-header {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #64748b;
    padding: 0.75rem 0.75rem 0.35rem;
}

.sidebar-item {
    margin-bottom: 0.35rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: #cbd5e1;
    text-decoration: none;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    gap: 0.85rem;
}

.sidebar-link i {
    font-size: 1.15rem;
    width: 24px;
    text-align: center;
    color: #94a3b8;
    transition: color 0.2s ease;
}

.sidebar-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.sidebar-link:hover i {
    color: #2dd4bf;
}

.sidebar-link.active {
    background: linear-gradient(135deg, #0d9488, #0f766e);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.35);
}

.sidebar-link.active i {
    color: #fff;
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.75rem;
    color: #94a3b8;
}

/* Main Content Area */
.main-content {
    margin-left: var(--sidebar-width);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: calc(100% - var(--sidebar-width));
}

/* Top Navbar */
.top-navbar {
    background: #ffffff;
    height: 70px;
    border-bottom: 1px solid var(--border-color);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 99;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.page-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.top-navbar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Content Container */
.content-body {
    padding: 2rem;
    flex-grow: 1;
}

/* Modern Cards */
.card-custom {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.75rem;
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card-custom:hover {
    box-shadow: var(--shadow-md);
}

.card-header-custom {
    padding: 1.25rem 1.5rem;
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header-custom h6 {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.card-body-custom {
    padding: 1.5rem;
}

/* Metric / Stat Cards */
.stat-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.stat-icon-wrapper {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    flex-shrink: 0;
}

.stat-icon-teal {
    background: rgba(13, 148, 136, 0.12);
    color: #0d9488;
}

.stat-icon-blue {
    background: rgba(2, 132, 199, 0.12);
    color: #0284c7;
}

.stat-icon-amber {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
}

.stat-icon-rose {
    background: rgba(225, 29, 72, 0.12);
    color: #e11d48;
}

.stat-details h3 {
    font-size: 1.65rem;
    font-weight: 800;
    margin: 0;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

.stat-details p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Buttons */
.btn-primary-custom {
    background: linear-gradient(135deg, #0d9488, #0f766e);
    border: none;
    color: #fff;
    font-weight: 600;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 10px rgba(13, 148, 136, 0.25);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary-custom:hover {
    background: linear-gradient(135deg, #0f766e, #115e59);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(13, 148, 136, 0.35);
}

.btn-secondary-custom {
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-weight: 600;
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-secondary-custom:hover {
    background: #e2e8f0;
    color: var(--text-main);
}

.btn-excel {
    background: #16a34a;
    color: #fff;
    font-weight: 600;
    padding: 0.55rem 1.15rem;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border: none;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-excel:hover {
    background: #15803d;
    color: #fff;
    transform: translateY(-1px);
}

.btn-pdf {
    background: #dc2626;
    color: #fff;
    font-weight: 600;
    padding: 0.55rem 1.15rem;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border: none;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-pdf:hover {
    background: #b91c1c;
    color: #fff;
    transform: translateY(-1px);
}

/* Tables */
.table-custom {
    width: 100%;
    margin-bottom: 0;
    vertical-align: middle;
}

.table-custom th {
    background: #f8fafc;
    color: #475569;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.9rem 1.15rem;
    border-bottom: 2px solid var(--border-color);
    border-top: none;
    white-space: nowrap;
}

.table-custom td {
    padding: 0.9rem 1.15rem;
    color: #334155;
    font-size: 0.9rem;
    border-bottom: 1px solid #f1f5f9;
}

.table-custom tbody tr:hover {
    background-color: rgba(204, 251, 241, 0.25);
}

/* Badges */
.badge-soft-success {
    background: #dcfce7;
    color: #15803d;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.badge-soft-warning {
    background: #fef3c7;
    color: #b45309;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.badge-soft-danger {
    background: #fee2e2;
    color: #b91c1c;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.badge-soft-info {
    background: #e0f2fe;
    color: #0369a1;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
}

/* Stock status indicator pill */
.stock-badge-live {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    display: inline-block;
    transition: all 0.2s ease;
}

/* Form Controls */
.form-label-custom {
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.4rem;
}

.form-control-custom, .form-select-custom {
    border: 1.5px solid #cbd5e1;
    border-radius: var(--radius-md);
    padding: 0.65rem 0.9rem;
    font-size: 0.9rem;
    color: var(--text-main);
    transition: all 0.2s;
    background-color: #fff;
    width: 100%;
}

.form-control-custom:focus, .form-select-custom:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.18);
    outline: none;
}

/* Dynamic Item Row Form */
.item-row {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1rem;
    position: relative;
    transition: border-color 0.2s;
}

.item-row:hover {
    border-color: #cbd5e1;
}

.btn-remove-row {
    background: #fee2e2;
    color: #ef4444;
    border: none;
    border-radius: 8px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-remove-row:hover {
    background: #ef4444;
    color: #fff;
}

/* Filter Card */
.filter-box {
    background: #ffffff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
}

/* ==========================================================================
   PRINT STYLES FOR SURAT BUKTI PENGELUARAN & LAPORAN
   ========================================================================== */
.print-paper {
    background: #ffffff;
    max-width: 850px;
    margin: 20px auto;
    padding: 40px 50px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border-radius: 4px;
    font-family: 'Times New Roman', Times, serif;
    color: #000;
}

.kop-surat {
    text-align: center;
    position: relative;
    padding-bottom: 10px;
}

.kop-logo {
    position: absolute;
    left: 10px;
    top: 5px;
    width: 75px;
    height: auto;
}

.kop-title-sub {
    font-size: 14pt;
    font-weight: bold;
    text-transform: uppercase;
    margin: 0;
    line-height: 1.2;
}

.kop-title-main {
    font-size: 16pt;
    font-weight: bold;
    text-transform: uppercase;
    margin: 3px 0;
    line-height: 1.2;
}

.kop-address {
    font-size: 10pt;
    margin: 0;
    font-style: italic;
}

.kop-line {
    border-top: 3px solid #000;
    border-bottom: 1px solid #000;
    height: 4px;
    margin: 10px 0 20px 0;
}

.surat-header-info {
    margin-bottom: 20px;
    font-size: 11pt;
    line-height: 1.6;
}

.surat-title {
    text-align: center;
    font-size: 13pt;
    font-weight: bold;
    text-transform: uppercase;
    text-decoration: underline;
    margin: 15px 0 5px 0;
}

.surat-nomor {
    text-align: center;
    font-size: 11pt;
    margin-bottom: 20px;
}

.table-surat {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 11pt;
}

.table-surat th, .table-surat td {
    border: 1px solid #000;
    padding: 8px 10px;
}

.table-surat th {
    background-color: #f2f2f2;
    text-align: center;
    font-weight: bold;
}

.tanda-tangan-container {
    margin-top: 40px;
    display: flex;
    justify-content: space-between;
    page-break-inside: avoid;
    font-size: 11pt;
}

.ttd-box {
    width: 42%;
    text-align: center;
}

.ttd-space {
    height: 75px;
}

.ttd-nama {
    font-weight: bold;
    text-decoration: underline;
}

.print-floating-bar {
    position: fixed;
    top: 15px;
    right: 20px;
    z-index: 9999;
    display: flex;
    gap: 10px;
}

@media print {
    body {
        background: #ffffff !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .print-floating-bar, .no-print {
        display: none !important;
    }

    .print-paper {
        box-shadow: none !important;
        margin: 0 !important;
        max-width: 100% !important;
        padding: 10mm 15mm !important;
        border: none !important;
    }

    @page {
        size: A4 portrait;
        margin: 15mm 15mm 15mm 15mm;
    }
}

/* Responsive adjustments */
@media (max-width: 991px) {
    .sidebar {
        transform: translateX(-100%);
    }

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

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    .content-body {
        padding: 1.25rem;
    }
}
