/* JYSAM Healthcare - Admin CSS */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Poppins:wght@600;700&display=swap');

:root {
    --primary: #0f9b8e;
    --primary-dark: #0a7a6f;
    --secondary: #1e3c72;
    --accent: #2ecc71;
    --danger: #e74c3c;
    --warning: #f39c12;
    --info: #3498db;
    --dark: #0d1b2a;
    --sidebar-w: 240px;
    --gradient: linear-gradient(135deg, #0f9b8e 0%, #1e3c72 100%);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    --radius: 12px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background: #f0f2f5;
    color: #212529;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

button {
    cursor: pointer;
    border: none;
    outline: none;
    background: none;
    font-family: inherit;
}

img {
    max-width: 100%;
}

/* ===== SIDEBAR ===== */
.admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-w);
    background: var(--dark);
    z-index: 1000;
    overflow-y: auto;
    transition: transform 0.3s;
}

.admin-sidebar::-webkit-scrollbar {
    width: 4px;
}

.admin-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
    padding: 22px 20px 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 8px;
}

.sidebar-logo .logo-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

.sidebar-logo .logo-text {
    color: white;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
}

.sidebar-logo .logo-sub {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 1px;
}

.sidebar-section {
    padding: 6px 12px;
    margin-top: 8px;
}

.sidebar-section-label {
    font-size: 10px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.3);
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 8px 8px 4px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border-radius: 8px;
    font-size: 13.5px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
    transition: all 0.2s;
    margin-bottom: 2px;
}

.sidebar-link i {
    width: 18px;
    font-size: 14px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.07);
    color: white;
}

.sidebar-link.active {
    background: var(--gradient);
    color: white;
}

.sidebar-link .badge-s {
    margin-left: auto;
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* ===== MAIN CONTENT ===== */
.admin-main {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== TOP NAV ===== */
.admin-topnav {
    background: white;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.topnav-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.page-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--dark);
}

.topnav-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.admin-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

/* ===== CONTENT AREA ===== */
.admin-content {
    padding: 24px;
    flex: 1;
}

/* ===== STAT CARDS ===== */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.admin-stat-card {
    background: white;
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s;
}

.admin-stat-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-3px);
}

.stat-icon-box {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.stat-info h3 {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--dark);
    line-height: 1;
}

.stat-info p {
    font-size: 13px;
    color: #adb5bd;
    margin-top: 3px;
}

.stat-trend {
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 3px;
    margin-top: 5px;
}

.trend-up {
    color: var(--accent);
}

.trend-dn {
    color: var(--danger);
}

/* ===== ADMIN TABLE ===== */
.admin-table-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 24px;
}

.card-header {
    padding: 18px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #f0f0f0;
}

.card-header h4 {
    font-size: 15px;
    font-weight: 700;
    color: var(--dark);
}

.card-body {
    padding: 0;
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th {
    padding: 13px 18px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #adb5bd;
    background: #fafafa;
    text-align: left;
}

.admin-table td {
    padding: 14px 18px;
    font-size: 13.5px;
    border-bottom: 1px solid #f5f5f5;
    color: var(--dark);
    vertical-align: middle;
}

.admin-table tbody tr:last-child td {
    border-bottom: none;
}

.admin-table tbody tr:hover td {
    background: #fafff9;
}

/* ===== BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

.badge-primary {
    background: #d4f5f2;
    color: #0f9b8e;
}

.badge-secondary {
    background: #e2e3e5;
    color: #383d41;
}

/* ===== FORMS ===== */
.admin-form-card {
    background: white;
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}

.admin-form-card h4 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1.5px solid #dee2e6;
    font-size: 14px;
    transition: all 0.2s;
    font-family: inherit;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15, 155, 142, 0.1);
    outline: none;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 20px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-primary {
    background: var(--gradient);
    color: white;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-success {
    background: var(--accent);
    color: white;
}

.btn-success:hover {
    filter: brightness(0.9);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    filter: brightness(0.9);
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-outline {
    background: white;
    border: 1.5px solid #dee2e6;
    color: #495057;
}

.btn-outline:hover {
    background: #f8f9fa;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 12.5px;
}

.btn-icon {
    width: 34px;
    height: 34px;
    padding: 0;
    justify-content: center;
    border-radius: 8px;
}

/* ===== SEARCH ===== */
.admin-search {
    position: relative;
}

.admin-search input {
    padding: 9px 14px 9px 38px;
    border-radius: 8px;
    border: 1.5px solid #dee2e6;
    width: 240px;
    font-size: 13.5px;
}

.admin-search i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #adb5bd;
    font-size: 13px;
}

/* ===== ALERTS ===== */
.admin-alert {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-alert-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid var(--accent);
}

.admin-alert-danger {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid var(--danger);
}

/* ===== CHART CONTAINER ===== */
.chart-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 22px;
    margin-bottom: 24px;
}

.chart-card h4 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 18px;
}

.chart-container {
    position: relative;
    height: 260px;
}

/* ===== PRODUCT IMAGE UPLOAD ===== */
.img-upload {
    border: 2px dashed #dee2e6;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.img-upload:hover {
    border-color: var(--primary);
    background: #f4fffe;
}

.img-upload i {
    font-size: 2.5rem;
    color: #dee2e6;
    display: block;
    margin-bottom: 8px;
}

.img-preview {
    max-height: 120px;
    max-width: 100%;
    border-radius: 8px;
    margin: 10px auto 0;
}

/* ===== TOGGLE SWITCH ===== */
.toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider-toggle {
    width: 40px;
    height: 22px;
    background: #dee2e6;
    border-radius: 11px;
    position: relative;
    transition: 0.3s;
}

.slider-toggle::before {
    content: '';
    position: absolute;
    left: 3px;
    top: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    transition: 0.3s;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

input:checked+.slider-toggle {
    background: var(--primary);
}

input:checked+.slider-toggle::before {
    transform: translateX(18px);
}

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
    padding: 16px 22px;
}

.page-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13.5px;
    font-weight: 600;
    border: 1.5px solid #dee2e6;
    color: #495057;
    transition: all 0.2s;
    cursor: pointer;
}

.page-btn:hover,
.page-btn.active {
    background: var(--gradient);
    border-color: transparent;
    color: white;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }

    .admin-sidebar.open {
        transform: translateX(0);
    }

    .admin-main {
        margin-left: 0;
    }

    .form-row,
    .form-row-3 {
        grid-template-columns: 1fr;
    }
}