/* 
  Rayyanos CSC Manager - Premium Earthy Tones Theme
  Author: Antigravity
*/

:root {
    /* Earthy Tones Palette */
    --bg-color: #f4f1ea;          /* Warm off-white background */
    --sidebar-bg: #2d332a;        /* Deep forest charcoal */
    --sidebar-hover: #3d453a;
    --sidebar-text: #e8ede3;
    
    --primary: #3d5a41;           /* Deep Forest Green */
    --primary-light: #527557;
    --primary-dark: #273b2a;
    
    --accent: #d97757;            /* Warm Terracotta */
    --accent-hover: #c46445;
    
    --surface: #ffffff;           /* Pure white for cards */
    --surface-2: #f0ece1;         /* Slightly darker surface for contrast */
    
    --text-main: #2c2c2c;
    --text-muted: #6b6b6b;
    --border-color: #e0dcd3;

    /* Status Colors */
    --success: #2e7d32;
    --success-bg: #e8f5e9;
    --warning: #f57f17;
    --warning-bg: #fff8e1;
    --danger: #c62828;
    --danger-bg: #ffebee;
    --info: #0277bd;
    --info-bg: #e1f5fe;

    /* Shadows & Effects */
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
    --shadow-lg: 0 12px 24px rgba(0,0,0,0.08);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--text-main);
}

.animate-fade-in {
    animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 260px;
    background: var(--sidebar-bg);
    z-index: 100;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.sidebar.close {
    width: 78px;
    overflow-x: hidden;
}

.sidebar .sidebar-header {
    height: 80px;
    display: flex;
    align-items: center;
    padding: 0 20px;
}

.sidebar .logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    font-size: 24px;
    font-weight: 600;
}

.sidebar .logo span {
    transition: opacity 0.3s ease;
    white-space: nowrap;
}

.sidebar.close .logo span {
    display: none;
}

.sidebar .logo i {
    font-size: 28px;
    color: var(--accent);
}

.sidebar .nav-links {
    margin-top: 20px;
    list-style: none;
    flex: 1;
}

.sidebar .nav-links li {
    position: relative;
    margin: 8px 12px;
}

.sidebar .nav-links li a {
    display: flex;
    align-items: center;
    text-decoration: none;
    border-radius: var(--radius-sm);
    padding: 12px;
    color: var(--sidebar-text);
    transition: var(--transition);
}

.sidebar .nav-links li a:hover,
.sidebar .nav-links li.active a {
    background: var(--sidebar-hover);
    color: #fff;
}

.sidebar .nav-links li.active a {
    background: var(--primary);
    box-shadow: 0 4px 10px rgba(61, 90, 65, 0.3);
}

.sidebar .nav-links li i {
    font-size: 22px;
    min-width: 40px;
    text-align: center;
}

.sidebar .nav-links li .link_name {
    font-size: 15px;
    font-weight: 400;
    white-space: nowrap;
}

.sidebar.close .nav-links li .link_name {
    display: none;
}

/* Sidebar Profile */
.profile-section {
    padding: 16px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.profile-details {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--sidebar-hover);
    padding: 10px;
    border-radius: var(--radius-sm);
    color: #fff;
}

.profile-details img {
    height: 40px;
    width: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.name-job .profile_name {
    font-size: 14px;
    font-weight: 500;
}
.name-job .job {
    font-size: 12px;
    color: #a0a0a0;
}

.sidebar.close .profile-details {
    background: none;
    padding: 0;
    justify-content: center;
}
.sidebar.close .name-job, .sidebar.close #log_out {
    display: none;
}

/* ===== HOME SECTION ===== */
.home-section {
    position: relative;
    left: 260px;
    width: calc(100% - 260px);
    transition: var(--transition);
    min-height: 100vh;
}

.sidebar.close ~ .home-section {
    left: 78px;
    width: calc(100% - 78px);
}

/* Top Header */
.top-header {
    height: 80px;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 99;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.sidebar-toggle {
    font-size: 26px;
    cursor: pointer;
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    width: 40px;
    border-radius: 50%;
    transition: var(--transition);
}

.sidebar-toggle:hover {
    background: var(--bg-color);
}

.page-title {
    font-size: 22px;
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--bg-color);
    border-radius: 24px;
    padding: 8px 16px;
    border: 1px solid transparent;
    transition: var(--transition);
}

.search-box:focus-within {
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 3px rgba(61, 90, 65, 0.1);
}

.search-box i {
    color: var(--text-muted);
    font-size: 20px;
}

.search-box input {
    border: none;
    background: none;
    outline: none;
    padding: 4px 8px;
    width: 250px;
    font-size: 14px;
    color: var(--text-main);
}

.notification-icon {
    position: relative;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
}

.notification-icon .badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--accent);
    color: #fff;
    font-size: 10px;
    font-weight: bold;
    height: 18px;
    width: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--surface);
}

/* View Container */
.view-container {
    padding: 32px;
    max-width: 1400px;
    margin: 0 auto;
}

/* ===== UI COMPONENTS ===== */
.panel {
    background: var(--surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    margin-bottom: 24px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.panel-header h2 {
    font-size: 18px;
    color: var(--text-main);
}

/* Buttons */
.btn-primary {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.btn-primary:hover {
    background: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: var(--bg-color);
    border-color: var(--text-muted);
}

.btn-text {
    background: none;
    border: none;
    color: var(--primary);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-text:hover {
    color: var(--primary-light);
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    border-radius: 50%;
    height: 36px;
    width: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.btn-icon:hover {
    background: var(--bg-color);
    color: var(--primary);
}

/* Utilities */
.mt-4 { margin-top: 24px; }

/* Dashboard Metrics */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.metric-card {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

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

.metric-icon {
    height: 48px;
    width: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.metric-info h3 {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 4px;
}

.metric-info h2 {
    font-size: 28px;
    margin-bottom: 8px;
}

.metric-info .trend {
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.trend.positive { color: var(--success); }
.trend.negative { color: var(--danger); }
.trend.pending { color: var(--warning); }

/* Dashboard Split */
.dashboard-split {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

/* Data Tables */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

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

.data-table th {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 600;
}

.data-table td {
    font-size: 14px;
}

.data-table.interactive tbody tr {
    cursor: pointer;
    transition: var(--transition);
}

.data-table.interactive tbody tr:hover {
    background: var(--surface-2);
}

/* Badges */
.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.completed { background: var(--success-bg); color: var(--success); }
.status-badge.processing { background: var(--info-bg); color: var(--info); }
.status-badge.pending { background: var(--warning-bg); color: var(--warning); }

/* Deadline List */
.deadline-list {
    list-style: none;
}

.deadline-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}

.deadline-item:last-child {
    border-bottom: none;
}

.deadline-icon {
    height: 40px;
    width: 40px;
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.deadline-details flex-1 {
    flex: 1;
}

.deadline-details h4 {
    font-size: 14px;
    margin-bottom: 4px;
}

.deadline-details p {
    font-size: 13px;
    color: var(--text-muted);
}

.deadline-date {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

.deadline-date.urgent {
    color: var(--accent);
}

/* Kanban Board */
.kanban-board {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    padding-bottom: 16px;
}

.kanban-column {
    background: var(--bg-color);
    border-radius: var(--radius-md);
    min-width: 320px;
    flex: 1;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    border: 1px solid var(--border-color);
}

.kanban-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 100px;
}

/* Small Grid View */
.kanban-items.small-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.kanban-items.small-grid .kanban-card {
    padding: 12px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.kanban-items.small-grid .kanban-card .card-header {
    margin-bottom: 4px;
}

.kanban-items.small-grid .kanban-card h4 {
    font-size: 13px;
    margin-bottom: 2px;
    line-height: 1.2;
}

.kanban-items.small-grid .kanban-card p {
    font-size: 11px;
    line-height: 1.2;
}

.kanban-items.small-grid .kanban-card .card-footer {
    margin-top: 8px;
    padding-top: 4px;
}

.column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.column-header h3 {
    font-size: 15px;
}

.column-header .count {
    background: var(--surface);
    color: var(--text-muted);
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
}

.kanban-card {
    background: var(--surface);
    border-radius: var(--radius-sm);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    cursor: grab;
    transition: var(--transition);
}

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

.card-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 12px;
}

.card-header .token {
    font-weight: 600;
    color: var(--primary);
}

.card-header .date {
    color: var(--text-muted);
}

.kanban-card h4 {
    font-size: 14px;
    margin-bottom: 4px;
}

.kanban-card p {
    font-size: 13px;
    color: var(--text-muted);
}

.card-footer {
    margin-top: 12px;
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid var(--border-color);
    padding-top: 8px;
}

/* Compact Kanban Mode */
.kanban-cards.compact .kanban-card {
    padding: 10px 12px;
}
.kanban-cards.compact .card-header {
    margin-bottom: 4px;
}
.kanban-cards.compact .kanban-card h4 {
    font-size: 13px;
    margin-bottom: 2px;
}
.kanban-cards.compact .kanban-card p {
    font-size: 11px;
}
.kanban-cards.compact .kanban-card .btn-text,
.kanban-cards.compact .kanban-card div[style*="font-size: 12px"] {
    font-size: 11px !important;
    margin-top: 4px !important;
}

/* Action Bar */
.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--surface);
    padding: 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    gap: 16px;
}

.action-group {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

/* Token Generator */
.token-ui {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--surface-2);
    padding: 32px;
    border-radius: var(--radius-sm);
}

.current-token .label {
    font-size: 14px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.current-token h1 {
    font-size: 64px;
    color: var(--primary);
    font-weight: 700;
    line-height: 1;
    margin-top: 8px;
}

.token-actions {
    display: flex;
    gap: 16px;
}

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

@media (max-width: 768px) {
    .sidebar {
        left: -260px;
        width: 260px;
    }
    
    .sidebar.close {
        left: 0;
        width: 260px;
        box-shadow: var(--shadow-lg);
    }
    
    .sidebar.close .nav-links li .link_name,
    .sidebar.close .name-job, 
    .sidebar.close #log_out {
        display: block !important;
    }
    
    .sidebar.close .profile-details {
        background: var(--sidebar-hover) !important;
        padding: 10px !important;
        justify-content: flex-start !important;
    }

    .home-section, .sidebar.close ~ .home-section {
        left: 0;
        width: 100%;
    }

    .header-left {
        gap: 10px;
    }

    .page-title {
        font-size: 18px;
    }

    .search-box input {
        width: 150px;
    }

    .view-container {
        padding: 16px;
    }

    .token-ui {
        flex-direction: column;
        gap: 24px;
        text-align: center;
    }

    .token-actions {
        flex-direction: column;
        width: 100%;
    }

    .token-actions button {
        width: 100%;
        justify-content: center;
    }

    #billing-form > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
    
    .action-bar {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    
    .action-group {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    
    .action-group.action-group-horizontal {
        flex-direction: row !important;
    }
    
    .action-bar .search-box {
        width: 100%;
    }
    
    .action-bar .search-box input {
        width: 100%;
    }

    .bill-actions {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    .bill-actions button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .top-header {
        padding: 0 16px;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .header-right .search-box input {
        display: none;
    }
    
    .header-right .search-box {
        padding: 8px;
        border-radius: 50%;
        cursor: pointer;
    }
    
    .header-right .search-box:focus-within input,
    .header-right .search-box input:not(:placeholder-shown) {
        display: block;
        width: 120px;
    }
    
    .header-right .search-box:focus-within {
        border-radius: 24px;
    }
    
    #notification-dropdown {
        width: 250px !important;
        right: -10px !important;
    }
    
    #login-overlay .modal-content {
        padding: 24px !important;
    }
}
