/* ============================================
   RemindersOS - Main Stylesheet
   ============================================ */

:root {
    --sidebar-bg: #1e3a5f;
    --sidebar-hover: #2a4f7a;
    --sidebar-active: #3a6ea8;
    --sidebar-text: #cdd9e5;
    --sidebar-width: 260px;
    --topbar-height: 56px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: #f0f2f5;
    margin: 0;
    padding: 0;
}

/* ============================================
   Sidebar
   ============================================ */
#wrapper {
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background-color: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    overflow-y: auto;
    transition: width 0.3s ease, transform 0.3s ease;
}

.sidebar-header {
    background-color: rgba(0,0,0,0.15);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-divider {
    border-top: 1px solid rgba(255,255,255,0.1);
    margin: 0.25rem 0;
}

.sidebar-section-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.4);
    padding: 0.5rem 1rem 0.25rem;
}

.sidebar-nav {
    flex: 1;
    padding: 0.5rem 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 1rem;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.9rem;
    transition: background-color 0.15s, color 0.15s;
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    background-color: var(--sidebar-hover);
    color: #fff;
    text-decoration: none;
}

.sidebar-link.active {
    background-color: var(--sidebar-active);
    color: #fff;
    border-left-color: #74b3f0;
    font-weight: 500;
}

.sidebar-link i {
    font-size: 1rem;
    width: 1.2rem;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-footer {
    margin-top: auto;
    padding-bottom: 0.5rem;
}

/* ============================================
   Main Content
   ============================================ */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease;
}

.top-bar {
    background-color: #fff;
    border-bottom: 1px solid #e2e8f0;
    height: var(--topbar-height);
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.content-area {
    flex: 1;
}

/* ============================================
   Auth Pages
   ============================================ */
.auth-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, #1e3a5f 0%, #2a5298 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.auth-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    padding: 2.5rem;
    width: 100%;
    max-width: 440px;
}

.auth-logo {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-logo i {
    font-size: 2.5rem;
    color: #1e3a5f;
}

/* ============================================
   Cards & Components
   ============================================ */
.stat-card {
    background: #fff;
    border-radius: 10px;
    padding: 1.25rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    transition: transform 0.15s, box-shadow 0.15s;
}

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

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.stat-card .stat-number {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.page-header {
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a202c;
    margin: 0;
}

.card {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.card-header {
    background-color: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-weight: 600;
    padding: 0.875rem 1.25rem;
}

/* ============================================
   Tables
   ============================================ */
.table {
    margin: 0;
}

.table th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #718096;
    background-color: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}

.table td {
    vertical-align: middle;
    font-size: 0.875rem;
}

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

/* ============================================
   Status Badges
   ============================================ */
.badge-status-scheduled { background-color: #3498db; }
.badge-status-confirmed { background-color: #2ecc71; }
.badge-status-completed { background-color: #95a5a6; color: #333; }
.badge-status-cancelled { background-color: #e74c3c; }
.badge-status-no_show { background-color: #e67e22; }

.badge-status-queued { background-color: #3498db; }
.badge-status-sent { background-color: #9b59b6; }
.badge-status-delivered { background-color: #2ecc71; }
.badge-status-failed { background-color: #e74c3c; }

/* ============================================
   Forms
   ============================================ */
.form-label {
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 0.35rem;
}

.form-control, .form-select {
    border-color: #cbd5e0;
    border-radius: 8px;
    font-size: 0.875rem;
}

.form-control:focus, .form-select:focus {
    border-color: #1e3a5f;
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

.btn {
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
}

.btn-primary {
    background-color: #1e3a5f;
    border-color: #1e3a5f;
}

.btn-primary:hover {
    background-color: #2a4f7a;
    border-color: #2a4f7a;
}

/* ============================================
   Sidebar Collapsed State
   ============================================ */
body.sidebar-collapsed .sidebar {
    width: 60px;
}

body.sidebar-collapsed .sidebar .sidebar-link span,
body.sidebar-collapsed .sidebar .sidebar-section-label,
body.sidebar-collapsed .sidebar .sidebar-footer .text-secondary,
body.sidebar-collapsed .sidebar .fw-bold {
    display: none;
}

body.sidebar-collapsed .sidebar-link {
    justify-content: center;
    padding: 0.55rem;
}

body.sidebar-collapsed .sidebar-link i {
    width: auto;
}

body.sidebar-collapsed .main-content {
    margin-left: 60px;
}

/* ============================================
   Calendar
   ============================================ */
#calendar {
    background: #fff;
    border-radius: 10px;
    padding: 1rem;
}

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

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

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

    body.sidebar-open::after {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.4);
        z-index: 999;
    }
}

/* ============================================
   Utilities
   ============================================ */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bg-primary-soft { background-color: rgba(30, 58, 95, 0.1); color: #1e3a5f; }
.bg-success-soft { background-color: rgba(46, 204, 113, 0.15); color: #1a7a4a; }
.bg-warning-soft { background-color: rgba(243, 156, 18, 0.15); color: #7d5a00; }
.bg-danger-soft { background-color: rgba(231, 76, 60, 0.15); color: #922b21; }
.bg-info-soft { background-color: rgba(52, 152, 219, 0.15); color: #1a5276; }

.credit-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
    color: #333;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}
