/* ============================
   Hospital Star10 ERP - CSS
   ============================ */

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    color: #333;
    background-color: #f4f6f9;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: #2c7be5;
}

a:hover {
    color: #1a5dc8;
}

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

.wrapper.sidebar-collapsed .sidebar {
    width: 0;
    overflow: hidden;
}

.wrapper.sidebar-collapsed .main-content {
    margin-left: 0;
}

/* ============================
   Sidebar
   ============================ */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #1e3a5f 0%, #152d4a 100%);
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    transition: width 0.3s ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

.sidebar-header i {
    margin-right: 8px;
    color: #4da3ff;
}

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

.sidebar-menu li {
    margin: 2px 0;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #c8d6e5;
    transition: all 0.2s ease;
    font-size: 14px;
}

.sidebar-menu li a:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
    padding-left: 25px;
}

.sidebar-menu li.active a {
    background: rgba(77, 163, 255, 0.15);
    color: #4da3ff;
    border-left: 3px solid #4da3ff;
}

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

.sidebar-footer {
    padding: 15px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    text-align: center;
}

.sidebar-footer p {
    color: #c8d6e5;
    font-size: 13px;
}

.sidebar-footer small {
    color: #8fa8c8;
    font-size: 11px;
}

/* ============================
   Main Content
   ============================ */
.main-content {
    margin-left: 260px;
    flex: 1;
    transition: margin-left 0.3s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================
   Top Navbar
   ============================ */
.top-navbar {
    background: #fff;
    padding: 12px 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar-left {
    display: flex;
    align-items: center;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 20px;
    color: #555;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background 0.2s;
}

.sidebar-toggle:hover {
    background: #f0f0f0;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.navbar-user {
    color: #555;
    font-size: 14px;
}

/* ============================
   Content Area
   ============================ */
.content {
    padding: 25px;
    flex: 1;
}

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

.page-header h1 {
    font-size: 22px;
    font-weight: 600;
    color: #1e3a5f;
}

.page-header h1 i {
    margin-right: 10px;
    color: #4da3ff;
}

/* ============================
   Stats Grid (Dashboard)
   ============================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.stat-card {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.stat-icon {
    width: 55px;
    height: 55px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.stat-patients .stat-icon {
    background: rgba(52, 152, 219, 0.12);
    color: #3498db;
}

.stat-doctors .stat-icon {
    background: rgba(46, 204, 113, 0.12);
    color: #2ecc71;
}

.stat-appointments .stat-icon {
    background: rgba(243, 156, 18, 0.12);
    color: #f39c12;
}

.stat-revenue .stat-icon {
    background: rgba(155, 89, 182, 0.12);
    color: #9b59b6;
}

.stat-info h3 {
    font-size: 24px;
    font-weight: 700;
    color: #1e3a5f;
}

.stat-info p {
    color: #7f8c8d;
    font-size: 13px;
    margin-top: 2px;
}

/* ============================
   Dashboard Grid
   ============================ */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

/* ============================
   Cards
   ============================ */
.card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    overflow: hidden;
}

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

.card-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1e3a5f;
}

.card-header h3 i {
    margin-right: 8px;
    color: #4da3ff;
}

.card-body {
    padding: 20px;
}

/* ============================
   Tables
   ============================ */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table thead th {
    background: #f8fafc;
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e2e8f0;
    text-align: left;
}

.table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13px;
    color: #475569;
}

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

.table tfoot td {
    padding: 10px 12px;
    font-size: 13px;
}

.text-right {
    text-align: right;
}

.text-muted {
    color: #94a3b8;
    font-style: italic;
}

/* ============================
   Badges
   ============================ */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.badge-success {
    background: rgba(46, 204, 113, 0.12);
    color: #27ae60;
}

.badge-danger {
    background: rgba(231, 76, 60, 0.12);
    color: #e74c3c;
}

.badge-warning {
    background: rgba(243, 156, 18, 0.12);
    color: #f39c12;
}

.badge-info {
    background: rgba(52, 152, 219, 0.12);
    color: #2980b9;
}

/* ============================
   Buttons
   ============================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.btn-primary {
    background: #2c7be5;
    color: #fff;
}

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

.btn-secondary {
    background: #6c757d;
    color: #fff;
}

.btn-secondary:hover {
    background: #545b62;
    color: #fff;
}

.btn-success {
    background: #2ecc71;
    color: #fff;
}

.btn-success:hover {
    background: #27ae60;
    color: #fff;
}

.btn-warning {
    background: #f39c12;
    color: #fff;
}

.btn-warning:hover {
    background: #d68910;
    color: #fff;
}

.btn-danger {
    background: #e74c3c;
    color: #fff;
}

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

.btn-info {
    background: #3498db;
    color: #fff;
}

.btn-info:hover {
    background: #2980b9;
    color: #fff;
}

.btn-logout {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
    padding: 6px 12px;
}

.btn-logout:hover {
    background: #e74c3c;
    color: #fff;
}

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

.btn-block {
    display: block;
    width: 100%;
    text-align: center;
    justify-content: center;
}

.actions {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

/* ============================
   Forms
   ============================ */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.form-full {
    grid-column: span 2;
}

.form-group {
    margin-bottom: 5px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
}

.form-control {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    color: #333;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
}

.form-control:focus {
    outline: none;
    border-color: #4da3ff;
    box-shadow: 0 0 0 3px rgba(77, 163, 255, 0.12);
}

textarea.form-control {
    resize: vertical;
}

select.form-control {
    appearance: auto;
}

.form-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

/* ============================
   Search Box
   ============================ */
.search-box {
    width: 220px;
}

.search-box .form-control {
    padding: 7px 12px;
    font-size: 12px;
}

/* ============================
   Detail View
   ============================ */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.detail-item {
    padding: 8px 0;
}

.detail-item label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.detail-item span {
    font-size: 14px;
    color: #1e293b;
}

.detail-full {
    grid-column: span 2;
}

/* ============================
   Alerts
   ============================ */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    transition: opacity 0.3s ease;
}

.alert-success {
    background: rgba(46, 204, 113, 0.1);
    color: #27ae60;
    border: 1px solid rgba(46, 204, 113, 0.2);
}

.alert-danger {
    background: rgba(231, 76, 60, 0.1);
    color: #c0392b;
    border: 1px solid rgba(231, 76, 60, 0.2);
}

/* ============================
   Filter Form
   ============================ */
.filter-form {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-form .form-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0;
}

.filter-form label {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    white-space: nowrap;
}

/* ============================
   Login Page
   ============================ */
.login-page {
    background: linear-gradient(135deg, #1e3a5f 0%, #2c7be5 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-box {
    background: #fff;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header i {
    color: #2c7be5;
    margin-bottom: 15px;
}

.login-header h1 {
    font-size: 24px;
    color: #1e3a5f;
    margin-bottom: 5px;
}

.login-header p {
    color: #7f8c8d;
    font-size: 14px;
}

.login-form .form-group {
    margin-bottom: 18px;
}

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

.login-form label i {
    margin-right: 5px;
    color: #4da3ff;
}

.login-form .form-control {
    padding: 12px 15px;
    font-size: 14px;
}

.login-form .btn {
    padding: 12px;
    font-size: 15px;
    margin-top: 10px;
}

.login-footer {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eef2f7;
}

.login-footer p {
    color: #94a3b8;
    font-size: 12px;
}

/* ============================
   Utilities
   ============================ */
.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

/* ============================
   Responsive
   ============================ */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 0;
        overflow: hidden;
    }

    .main-content {
        margin-left: 0;
    }

    .wrapper.sidebar-collapsed .sidebar {
        width: 260px;
    }

    .wrapper.sidebar-collapsed .main-content {
        margin-left: 260px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-full {
        grid-column: span 1;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .detail-full {
        grid-column: span 1;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .search-box {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .content {
        padding: 15px;
    }

    .login-box {
        padding: 25px;
    }
}
