/* assets/css/style.css - Premium Police Pharmacy stylesheet */

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

:root {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --sidebar-bg: #0f172a;
    --sidebar-hover: #1e293b;
    --text-primary: #0f172a;
    --text-muted: #64748b;
    --text-light: #f1f5f9;
    --primary: #1e40af;
    --primary-light: #3b82f6;
    --primary-rgb: 30, 64, 175;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --border-color: #e2e8f0;
    --border-radius: 12px;
    --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);
    --transition: all 0.2s ease-in-out;
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    display: flex;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

/* App Layout */
.app-container {
    display: flex;
    width: 100%;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    flex-shrink: 0;
    box-shadow: var(--shadow-lg);
    z-index: 100;
}

.sidebar-brand {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #3b82f6;
    border-bottom: 1px solid #1e293b;
    padding-bottom: 1rem;
}

.sidebar-brand span {
    color: var(--text-light);
}

.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-grow: 1;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    color: #94a3b8;
    font-weight: 500;
    transition: var(--transition);
}

.sidebar-link:hover, .sidebar-link.active {
    background-color: var(--sidebar-hover);
    color: var(--text-light);
}

.sidebar-link.active {
    border-left: 4px solid var(--primary-light);
}

.sidebar-footer {
    border-top: 1px solid #1e293b;
    padding-top: 1rem;
    margin-top: auto;
}

/* Main Content Area */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0; /* Prevents flex items from breaking layout overflow */
}

/* Top Navbar */
.navbar {
    height: 70px;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    box-shadow: var(--shadow-sm);
}

.nav-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-badge {
    background-color: rgba(30, 64, 175, 0.1);
    color: var(--primary);
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
}

.btn-logout {
    padding: 0.5rem 1rem;
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
}

.btn-logout:hover {
    background-color: var(--danger);
    color: white;
    border-color: var(--danger);
}

/* Page Body */
.page-body {
    padding: 2rem;
    flex-grow: 1;
    overflow-y: auto;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

/* Grid & Layout System */
.grid-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Stat Cards */
.card-stat {
    background-color: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: var(--transition);
}

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

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-val {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0.5rem 0;
}

.stat-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.stat-desc.danger {
    color: var(--danger);
    font-weight: 600;
}

.stat-desc.success {
    color: var(--success);
    font-weight: 600;
}

/* Cards */
.card {
    background-color: var(--bg-secondary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
    overflow: hidden;
}

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

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 1.5rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    font-family: inherit;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.form-col {
    flex: 1;
    min-width: 200px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--border-radius);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

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

.btn-primary:hover {
    background-color: #1d4ed8;
}

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

.btn-success:hover {
    background-color: #059669;
}

.btn-danger {
    background-color: var(--danger);
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
}

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

.btn-secondary:hover {
    background-color: #cbd5e1;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    border-radius: 8px;
}

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

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: 0.95rem;
}

.table th, .table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background-color: #f8fafc;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
}

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

/* Badges */
.badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
    text-transform: uppercase;
}

.badge-success {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-info {
    background-color: #e0f2fe;
    color: #0369a1;
}

/* Split-screen login page */
.login-container {
    display: flex;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

.login-side-visual {
    flex: 1.2;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4rem;
    position: relative;
}

.login-side-visual::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(circle at 20% 30%, rgba(59, 130, 246, 0.2) 0%, transparent 50%),
                      radial-gradient(circle at 80% 70%, rgba(16, 185, 129, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.login-side-form {
    flex: 1;
    background-color: var(--bg-secondary);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4rem;
    overflow-y: auto;
}

.login-header h1 {
    font-size: 2.25rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: #3b82f6;
}

.login-header p {
    color: #94a3b8;
    margin-bottom: 3rem;
}

.login-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.login-desc {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

/* Dynamic Rows Styling */
.dynamic-row {
    background-color: #fafafa;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 1rem;
    position: relative;
}

.dynamic-row-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.dynamic-row-remove {
    cursor: pointer;
    color: var(--danger);
    font-weight: 600;
}

/* Search bar styling */
.search-wrapper {
    position: relative;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    max-height: 250px;
    overflow-y: auto;
    z-index: 10;
    box-shadow: var(--shadow-lg);
}

.search-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.search-item:hover {
    background-color: #f1f5f9;
}

/* Reports Layout */
.report-filters {
    background-color: #fafafa;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

.report-summary-boxes {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.report-summary-box {
    background-color: #f1f5f9;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    flex: 1;
    min-width: 150px;
    border-left: 4px solid var(--primary);
}

.report-summary-title {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
}

.report-summary-value {
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 0.25rem;
}

/* Tabs */
.report-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.report-tab-btn {
    padding: 0.5rem 1.25rem;
    border-radius: 6px;
    background: none;
    border: none;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.report-tab-btn:hover {
    color: var(--text-primary);
    background-color: #e2e8f0;
}

.report-tab-btn.active {
    color: white;
    background-color: var(--primary);
}

/* Mock Mail View */
.email-log-item {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    overflow: hidden;
}

.email-log-header {
    background-color: #f8fafc;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.email-log-body {
    padding: 1rem;
    background-color: white;
    font-size: 0.9rem;
}

/* Profile timeline */
.timeline {
    position: relative;
    padding-left: 2rem;
    border-left: 2px solid var(--border-color);
    margin-left: 1rem;
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -2.35rem;
    top: 0.25rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--primary-light);
    border: 2px solid var(--bg-secondary);
}

.timeline-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.timeline-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.timeline-content {
    background-color: #fafafa;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.75rem 1rem;
}

/* Printing styles for reports */
@media print {
    body {
        background-color: white !important;
        color: black !important;
    }
    
    .sidebar, .navbar, .report-filters, .btn, .btn-logout, .email-log-section, .sidebar-footer {
        display: none !important;
    }
    
    .main-content {
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .page-body {
        padding: 0 !important;
    }
    
    .card {
        border: none !important;
        box-shadow: none !important;
    }
    
    .card-header {
        border-bottom: 2px solid black !important;
        background-color: transparent !important;
        padding-left: 0 !important;
    }
    
    .table th {
        background-color: #f1f5f9 !important;
        color: black !important;
        border-bottom: 2px solid black !important;
    }
    
    .table td {
        border-bottom: 1px solid #ccc !important;
    }
}

/* Custom Searchable Select Dropdown */
.search-select-container {
    position: relative;
    width: 100%;
}
.search-select-input-container {
    position: relative;
    width: 100%;
}
.search-select-toggle {
    cursor: pointer;
    background-color: var(--bg-secondary) !important;
}
.search-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    box-shadow: var(--shadow-lg);
    max-height: 220px;
    overflow-y: auto;
    z-index: 9999;
    display: none;
}
.search-select-search {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: none;
    border-bottom: 1px solid var(--border-color);
    outline: none;
    font-size: 0.9rem;
    box-sizing: border-box;
}
.search-select-option {
    padding: 0.6rem 1rem;
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition);
    text-align: left;
}
.search-select-option:hover {
    background-color: #f1f5f9;
    color: var(--primary);
}
.search-select-option.selected {
    background-color: rgba(30, 64, 175, 0.1);
    font-weight: 600;
    color: var(--primary);
}
.search-select-no-results {
    padding: 0.6rem 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-style: italic;
    text-align: center;
}

/* Dashboard Card Detail Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease-in-out;
}
.modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}
.modal-container {
    background-color: var(--bg-secondary);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 850px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.25s ease-in-out;
}
.modal-overlay.open .modal-container {
    transform: scale(1);
}
.modal-header {
    padding: 1.25rem 1.5rem;
    background-color: #f8fafc;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
}
.modal-close {
    font-size: 1.75rem;
    font-weight: bold;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    transition: var(--transition);
}
.modal-close:hover {
    color: var(--danger);
}
.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex-grow: 1;
}
.card-stat.clickable {
    cursor: pointer;
    position: relative;
    border-bottom: 4px solid var(--border-color);
    transition: var(--transition);
}
.card-stat.clickable:hover {
    border-bottom-color: var(--primary-light);
    transform: translateY(-4px);
}
.card-stat.clickable::after {
    content: "Click to View Details";
    font-size: 0.7rem;
    color: var(--primary-light);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.5rem;
    text-align: right;
    display: block;
}

/* Print Slip Styles */
.print-slip-body {
    background-color: white !important;
    font-family: 'Inter', sans-serif;
    color: black !important;
    margin: 0 !important;
    padding: 0 !important;
}
.slip-page {
    width: 210mm;
    height: 297mm;
    box-sizing: border-box;
    padding: 8mm 10mm;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background-color: white;
    margin: 0 auto;
}
.slip-half {
    height: 132mm;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 4mm;
    position: relative;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}
.slip-header {
    text-align: center;
    border-bottom: 2px solid #0f172a;
    padding-bottom: 0.4rem;
    margin-bottom: 0.8rem;
}
.slip-header h2 {
    font-size: 1.25rem;
    font-weight: 800;
    color: #1e3a8a;
    margin: 0 0 0.15rem 0;
    letter-spacing: 0.5px;
}
.slip-header p {
    font-size: 0.75rem;
    color: #475569;
    margin: 0;
    font-weight: 500;
}
.slip-label {
    position: absolute;
    top: 4mm;
    right: 4mm;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    border: 1.5px solid #0f172a;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    letter-spacing: 0.5px;
}
.slip-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.4rem;
    font-size: 0.8rem;
    margin-bottom: 0.8rem;
    background-color: #f8fafc;
    padding: 0.6rem;
    border-radius: 6px;
}
.slip-info-item {
    margin-bottom: 0.2rem;
}
.slip-info-item strong {
    color: #475569;
    font-weight: 600;
}
.slip-separator-line {
    border-top: 2px dashed #94a3b8;
    height: 1px;
    width: 100%;
    margin: 4mm 0;
    position: relative;
}
.slip-separator-text {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background-color: white;
    padding: 0 10px;
    font-size: 0.7rem;
    color: #64748b;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.slip-signatures {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    font-size: 0.8rem;
}
.slip-signature-line {
    border-top: 1px solid #475569;
    width: 160px;
    text-align: center;
    padding-top: 0.25rem;
    margin-top: 1.5rem;
    font-weight: 600;
    color: #334155;
}
.slip-table th {
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
    font-weight: 700 !important;
    font-size: 0.75rem !important;
    padding: 0.4rem 0.6rem !important;
    border-bottom: 1.5px solid #0f172a !important;
}
.slip-table td {
    padding: 0.4rem 0.6rem !important;
    font-size: 0.8rem !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

@media print {
    .slip-page {
        padding: 0 !important;
        margin: 0 !important;
    }
}

