/* ============================================================
   SIPRAK — Main Stylesheet (Modern & Minimalist Light/Dark Theme)
   ============================================================ */

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

:root {
    /* Light Theme (Default) */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #e0e7ff;
    
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --info: #06b6d4;
    --info-light: #ecfeff;
    
    --border: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
    
    --sidebar-width: 260px;
    --topbar-height: 70px;
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Theme overrides class */
[data-theme="dark"] {
    --bg-primary: #090d16;
    --bg-secondary: #111827;
    --bg-tertiary: #1f2937;
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --text-muted: #6b7280;
    
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: #1e1b4b;
    
    --success: #10b981;
    --success-light: #064e3b;
    --warning: #f59e0b;
    --warning-light: #78350f;
    --danger: #ef4444;
    --danger-light: #7f1d1d;
    --info: #06b6d4;
    --info-light: #164e63;
    
    --border: #2d3748;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
}

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

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}
html {
    scrollbar-width: thin;
    scrollbar-color: var(--border) var(--bg-primary);
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    transition: background-color 0.3s, color 0.3s;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    font-size: 16px; /* Increased base font size from default 15px */
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}
a:hover {
    color: var(--primary-hover);
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}

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

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border);
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

.sidebar-brand {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid var(--border);
}

.sidebar-brand h2 {
    font-size: 22px; /* Increased from 20px */
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.5px;
}

.sidebar-menu {
    flex: 1;
    padding: 24px 16px;
    list-style: none;
    overflow-y: auto;
}

.sidebar-menu-item {
    margin-bottom: 6px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 15px; /* Increased from 14px */
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

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

.sidebar-link svg {
    width: 22px; /* Increased from 20px */
    height: 22px;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border);
}

.user-profile-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: var(--radius-sm);
}

.user-profile-bar img {
    width: 40px; /* Increased from 36px */
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background-color: var(--bg-tertiary);
}

.user-info-text {
    overflow: hidden;
}

.user-info-text .name {
    font-size: 14px; /* Increased from 13px */
    font-weight: 600;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.user-info-text .role {
    font-size: 12px; /* Increased from 11px */
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Main Content Area */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    transition: var(--transition);
}

/* Topbar */
.topbar {
    height: var(--topbar-height);
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 99;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.breadcrumb {
    font-size: 15px; /* Increased from 14px */
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.breadcrumb-separator {
    color: var(--text-muted);
}

.breadcrumb-active {
    color: var(--text-primary);
    font-weight: 600;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Theme Toggle & Icons */
.icon-btn {
    width: 44px; /* Increased from 40px */
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background-color: var(--bg-secondary);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}
.icon-btn:hover {
    background-color: var(--bg-tertiary);
    color: var(--primary);
}

.icon-btn svg {
    width: 22px; /* Increased from 20px */
    height: 22px;
}

/* Page Body Container */
.page-container {
    padding: 32px;
    flex: 1;
}

.page-header {
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.page-title h1 {
    font-size: 28px; /* Increased from 26px */
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 6px;
}

.page-title p {
    color: var(--text-secondary);
    font-size: 15px; /* Increased from 14px */
}

.page-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.metric-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition);
}

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

.metric-info h3 {
    font-size: 14px; /* Increased from 13px */
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.metric-value {
    font-size: 30px; /* Increased from 28px */
    font-weight: 800;
    color: var(--text-primary);
}

.metric-icon {
    width: 52px; /* Increased from 48px */
    height: 52px;
    border-radius: 12px;
    background-color: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.metric-icon svg {
    width: 26px; /* Increased from 24px */
    height: 26px;
}

/* Cards & Containers */
.card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-size: 18px; /* Increased from 16px */
    font-weight: 700;
}

/* Forms styling */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 15px; /* Increased from 14px */
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 15px; /* Increased from 14px */
    outline: none;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23475569'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
    padding-right: 40px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-group input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 15px; /* Increased from 14px */
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition);
    font-family: inherit;
}

.btn-primary {
    background-color: var(--primary);
    color: #ffffff;
}
.btn-primary:hover {
    background-color: var(--primary-hover);
    color: #ffffff;
}

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

.btn-danger {
    background-color: var(--danger);
    color: #ffffff;
}
.btn-danger:hover {
    background-color: #dc2626;
    color: #ffffff;
}

.btn-success {
    background-color: var(--success);
    color: #ffffff;
}
.btn-success:hover {
    background-color: #059669;
    color: #ffffff;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px; /* Increased from 12px */
    border-radius: 6px;
}

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

.table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 15px; /* Increased from 14px */
}

.table th {
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    font-weight: 600;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
}

.table td {
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
}

.table tr:hover td {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 12px; /* Increased from 11px */
    font-weight: 600;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background-color: var(--success-light);
    color: var(--success);
}

.badge-warning {
    background-color: var(--warning-light);
    color: var(--warning);
}

.badge-danger {
    background-color: var(--danger-light);
    color: var(--danger);
}

.badge-info {
    background-color: var(--info-light);
    color: var(--info);
}

.badge-neutral {
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
}

/* Alerts */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
    font-size: 15px; /* Increased from 14px */
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid transparent;
}

.alert-success {
    background-color: var(--success-light);
    color: var(--success);
    border-color: var(--success);
}

.alert-warning {
    background-color: var(--warning-light);
    color: var(--warning);
    border-color: var(--warning);
}

.alert-danger {
    background-color: var(--danger-light);
    color: var(--danger);
    border-color: var(--danger);
}

/* Calendar timeline UI */
.timeline {
    position: relative;
    padding-left: 32px;
    border-left: 2px solid var(--border);
}

.timeline-item {
    position: relative;
    margin-bottom: 24px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -41px;
    top: 4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: var(--bg-secondary);
    border: 3px solid var(--primary);
}

.timeline-date {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
    text-transform: uppercase;
}

.timeline-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
}

.timeline-desc {
    font-size: 15px;
    color: var(--text-secondary);
}

/* Custom UI Grid & details */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.detail-layout-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 24px;
    align-items: start;
}


.detail-item {
    border-bottom: 1px solid var(--border);
    padding-bottom: 12px;
}

.detail-label {
    font-size: 14px; /* Increased from 13px */
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.detail-value {
    font-size: 18px; /* Increased from 16px */
    font-weight: 600; /* Increased font weight slightly too for better clarity */
    color: var(--text-primary);
    word-break: break-word;
}

/* Hamburger menu for mobile */
.menu-toggle {
    display: none;
}

/* Responsive styles */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .menu-toggle {
        display: flex;
    }
    .detail-layout-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .detail-grid {
        grid-template-columns: 1fr;
    }
    .topbar {
        padding: 0 16px;
    }
    .page-container {
        padding: 20px 16px;
    }
}

/* Sidebar Dropdown Menu Styling */
.sidebar-menu-item.has-dropdown {
    position: relative;
}
.sidebar-dropdown-menu {
    list-style: none;
    padding-left: 36px;
    margin-top: 4px;
    margin-bottom: 4px;
    display: none; /* Hidden by default */
}
.sidebar-dropdown-menu.show {
    display: block; /* Shown when active */
}
.sidebar-dropdown-menu li {
    margin-bottom: 4px;
}
.sidebar-dropdown-menu a {
    display: block;
    padding: 8px 12px;
    font-size: 14px;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    font-weight: 500;
    transition: var(--transition);
    text-decoration: none;
}
.sidebar-dropdown-menu a:hover,
.sidebar-dropdown-menu a.active {
    background-color: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}
/* Rotate chevron when open */
.sidebar-link.open .dropdown-chevron {
    transform: rotate(180deg);
}
