/* ═══════════════════════════════════════════════════════════════════════════
   NissiHub — Design System
   Operations Hub by Nissigrid Technologies
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── CSS Variables ───────────────────────────────────────────────────────── */
:root {
    /* Positive, vibrant color palette */
    --primary: #6C63FF;
    --primary-hover: #5A52E0;
    --primary-light: #E8E6FF;
    --primary-dark: #4840B0;

    --secondary: #845EF7;
    --secondary-light: #EDE8FF;

    --accent: #00D2D3;
    --accent-light: #E0FAFA;

    --success: #00C9A7;
    --success-light: #E0FFF8;
    --success-dark: #00A88C;

    --warning: #FFB830;
    --warning-light: #FFF5E0;
    --warning-dark: #E5A020;

    --danger: #FF6B6B;
    --danger-light: #FFE8E8;
    --danger-dark: #E04545;

    --info: #45AAF2;
    --info-light: #E4F3FF;

    /* Neutral palette */
    --gray-50: #F8FAFC;
    --gray-100: #F1F5F9;
    --gray-200: #E2E8F0;
    --gray-300: #CBD5E1;
    --gray-400: #94A3B8;
    --gray-500: #64748B;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1E293B;
    --gray-900: #0F172A;

    /* Sidebar */
    --sidebar-bg: #1A1A2E;
    --sidebar-hover: rgba(255, 255, 255, 0.08);
    --sidebar-active: rgba(108, 99, 255, 0.25);
    --sidebar-text: #B4B6C4;
    --sidebar-text-active: #FFFFFF;
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 72px;

    /* Layout */
    --topbar-height: 64px;
    --bg-page: #F0F2F8;
    --bg-card: #FFFFFF;
    --bg-card-hover: #FAFAFF;

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --text-primary: #1E293B;
    --text-secondary: #64748B;
    --text-muted: #94A3B8;

    /* Borders & Shadows */
    --border-color: #E2E8F0;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.12);
    --shadow-glow: 0 4px 20px rgba(108, 99, 255, 0.2);

    /* Transitions */
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;
}


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

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    color: var(--text-primary);
    background: var(--bg-page);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
}

input, select, textarea {
    font-family: inherit;
    font-size: inherit;
}


/* ─── Login Page ──────────────────────────────────────────────────────────── */
.login-page {
    min-height: 100vh;
    display: flex;
    background: var(--bg-page);
}

.login-container {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

.login-branding {
    flex: 1;
    background: linear-gradient(135deg, #6C63FF 0%, #845EF7 50%, #00D2D3 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    position: relative;
    overflow: hidden;
}

.login-branding::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 70%, rgba(255,255,255,0.1) 0%, transparent 50%);
    animation: float 15s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -30px) rotate(5deg); }
    66% { transform: translate(-20px, 20px) rotate(-3deg); }
}

.branding-content {
    text-align: center;
    color: white;
    position: relative;
    z-index: 1;
}

.brand-logo-large {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.brand-logo-large img {
    filter: brightness(0) invert(1);
    width: 56px;
    height: 56px;
}

.brand-logo-large h1 {
    font-size: 2.8rem;
    font-weight: 800;
    letter-spacing: -1px;
}

.brand-tagline {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 3rem;
    font-weight: 300;
}

.brand-features {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 3rem;
}

.brand-feature-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1rem;
    opacity: 0.9;
    padding: 0.6rem 1.2rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-sm);
    backdrop-filter: blur(10px);
}

.brand-feature-item i {
    width: 20px;
    text-align: center;
}

.brand-company {
    font-size: 0.85rem;
    opacity: 0.7;
    font-weight: 300;
}

.login-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    background: white;
}

.login-form-wrapper {
    width: 100%;
    max-width: 400px;
}

.login-header {
    margin-bottom: 2rem;
}

.login-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-secondary);
}

.login-form .form-group {
    margin-bottom: 1.25rem;
}

.login-form label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.login-form label i {
    margin-right: 0.4rem;
    color: var(--primary);
}

.login-form input {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius-sm);
    font-size: 0.95rem;
    transition: var(--transition);
    background: var(--gray-50);
}

.login-form input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px var(--primary-light);
}

.password-input-wrapper {
    position: relative;
}

.password-input-wrapper input {
    padding-right: 3rem;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    padding: 4px;
}

.password-toggle:hover {
    color: var(--primary);
}

.form-error {
    color: var(--danger);
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
    background: var(--danger-light);
    border-radius: var(--border-radius-sm);
    margin-bottom: 1rem;
}


/* ─── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.4rem;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
    border: 2px solid transparent;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(108, 99, 255, 0.35);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--text-primary);
    border-color: var(--gray-200);
}

.btn-secondary:hover {
    background: var(--gray-200);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #00E0B8);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: var(--danger-dark);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

.btn-block {
    width: 100%;
    padding: 0.9rem;
    font-size: 1rem;
}

.btn-icon {
    padding: 0.5rem;
    width: 36px;
    height: 36px;
    border-radius: var(--border-radius-sm);
}


/* ─── App Layout ──────────────────────────────────────────────────────────── */
.app-page {
    display: flex;
    min-height: 100vh;
}


/* ─── Sidebar ─────────────────────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: var(--transition);
    overflow: hidden;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    min-height: 64px;
}

.sidebar-logo {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.sidebar-brand {
    font-size: 1.3rem;
    font-weight: 800;
    color: white;
    letter-spacing: -0.5px;
    white-space: nowrap;
}

.sidebar-toggle-btn {
    margin-left: auto;
    color: var(--sidebar-text);
    padding: 6px;
    border-radius: 6px;
    transition: var(--transition-fast);
}

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

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 0;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.nav-section {
    margin-bottom: 0.5rem;
}

.nav-section-title {
    display: block;
    padding: 0.75rem 1.5rem 0.4rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--gray-500);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1.5rem;
    color: var(--sidebar-text);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition-fast);
    position: relative;
    margin: 1px 0.5rem;
    border-radius: var(--border-radius-sm);
}

.nav-item:hover {
    color: var(--sidebar-text-active);
    background: var(--sidebar-hover);
}

.nav-item.active {
    color: var(--sidebar-text-active);
    background: var(--sidebar-active);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--primary);
    border-radius: 0 4px 4px 0;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 0.5rem 0;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
}

.user-avatar, .user-avatar-sm {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.user-avatar-sm {
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
}

.user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-name {
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    color: var(--gray-500);
    font-size: 0.7rem;
    text-transform: capitalize;
}

.logout-link:hover {
    color: var(--danger) !important;
}


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


/* ─── Top Bar ─────────────────────────────────────────────────────────────── */
.topbar {
    height: var(--topbar-height);
    background: white;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mobile-menu-btn {
    display: none;
    color: var(--text-primary);
    font-size: 1.2rem;
    padding: 6px;
}

.page-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--gray-100);
    border-radius: var(--border-radius-sm);
    padding: 0.5rem 0.75rem;
    gap: 0.5rem;
    transition: var(--transition);
    border: 2px solid transparent;
}

.search-box:focus-within {
    background: white;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

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

.search-box input {
    border: none;
    background: none;
    outline: none;
    font-size: 0.85rem;
    width: 200px;
    color: var(--text-primary);
}

.topbar-btn {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.topbar-btn:hover {
    background: var(--gray-100);
    color: var(--primary);
}

.notification-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 18px;
    height: 18px;
    background: var(--danger);
    color: white;
    border-radius: 50px;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}


/* ─── Page Content ────────────────────────────────────────────────────────── */
.page-content {
    padding: 1.5rem;
    flex: 1;
}


/* ─── Cards ───────────────────────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    font-size: 1rem;
    font-weight: 700;
}

.card-body {
    padding: 1.5rem;
}


/* ─── Stats Cards ─────────────────────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

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

.stat-card.primary::after { background: linear-gradient(to bottom, var(--primary), var(--secondary)); }
.stat-card.success::after { background: linear-gradient(to bottom, var(--success), var(--accent)); }
.stat-card.warning::after { background: linear-gradient(to bottom, var(--warning), #FFD93D); }
.stat-card.danger::after { background: linear-gradient(to bottom, var(--danger), #FF8787); }
.stat-card.info::after { background: linear-gradient(to bottom, var(--info), #74C0FC); }
.stat-card.accent::after { background: linear-gradient(to bottom, var(--accent), #5CF5E3); }

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.stat-card.primary .stat-icon { background: var(--primary-light); color: var(--primary); }
.stat-card.success .stat-icon { background: var(--success-light); color: var(--success); }
.stat-card.warning .stat-icon { background: var(--warning-light); color: var(--warning); }
.stat-card.danger .stat-icon { background: var(--danger-light); color: var(--danger); }
.stat-card.info .stat-icon { background: var(--info-light); color: var(--info); }
.stat-card.accent .stat-icon { background: var(--accent-light); color: var(--accent); }

.stat-info h4 {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--text-primary);
}

.stat-info p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-top: 2px;
}


/* ─── Content Grid ────────────────────────────────────────────────────────── */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

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


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

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

thead th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: white;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    white-space: nowrap;
}

thead th:first-child {
    border-radius: var(--border-radius-sm) 0 0 0;
}

thead th:last-child {
    border-radius: 0 var(--border-radius-sm) 0 0;
}

tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.9rem;
    vertical-align: middle;
}

tbody tr {
    transition: var(--transition-fast);
}

tbody tr:hover {
    background: var(--gray-50);
}

tbody tr:last-child td {
    border-bottom: none;
}


/* ─── Badges / Status Tags ────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.6rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: var(--success-light); color: var(--success-dark); }
.badge-warning { background: var(--warning-light); color: var(--warning-dark); }
.badge-danger { background: var(--danger-light); color: var(--danger-dark); }
.badge-info { background: var(--info-light); color: var(--info); }
.badge-secondary { background: var(--gray-100); color: var(--gray-600); }

/* Status-specific badges */
.status-todo { background: var(--gray-100); color: var(--gray-600); }
.status-in_progress { background: var(--info-light); color: var(--info); }
.status-review { background: var(--warning-light); color: var(--warning-dark); }
.status-done { background: var(--success-light); color: var(--success-dark); }
.status-active { background: var(--success-light); color: var(--success-dark); }
.status-on_hold { background: var(--warning-light); color: var(--warning-dark); }
.status-completed { background: var(--primary-light); color: var(--primary); }
.status-archived { background: var(--gray-100); color: var(--gray-500); }

/* Priority badges */
.priority-low { background: var(--gray-100); color: var(--gray-500); }
.priority-medium { background: var(--info-light); color: var(--info); }
.priority-high { background: var(--warning-light); color: var(--warning-dark); }
.priority-urgent { background: var(--danger-light); color: var(--danger-dark); }


/* ─── Modal ───────────────────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.modal {
    background: white;
    border-radius: var(--border-radius-lg);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-lg {
    max-width: 800px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 700;
}

.modal-close {
    font-size: 1.5rem;
    color: var(--text-muted);
    padding: 4px;
    line-height: 1;
    transition: var(--transition-fast);
}

.modal-close:hover {
    color: var(--danger);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: calc(90vh - 140px);
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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


/* ─── Forms ───────────────────────────────────────────────────────────────── */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.4rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.form-control {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius-sm);
    font-size: 0.9rem;
    transition: var(--transition);
    background: var(--gray-50);
    color: var(--text-primary);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px var(--primary-light);
}

select.form-control {
    cursor: pointer;
}

textarea.form-control {
    min-height: 80px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}


/* ─── Toast Notifications ─────────────────────────────────────────────────── */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.25rem;
    border-radius: var(--border-radius-sm);
    background: white;
    box-shadow: var(--shadow-lg);
    animation: slideInRight 0.3s ease;
    min-width: 300px;
    border-left: 4px solid;
}

.toast-success { border-color: var(--success); }
.toast-error { border-color: var(--danger); }
.toast-warning { border-color: var(--warning); }
.toast-info { border-color: var(--info); }

.toast i {
    font-size: 1.1rem;
}

.toast-success i { color: var(--success); }
.toast-error i { color: var(--danger); }
.toast-warning i { color: var(--warning); }
.toast-info i { color: var(--info); }

.toast-message {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 500;
}

.toast-close {
    color: var(--text-muted);
    padding: 4px;
    font-size: 1rem;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}


/* ─── Loading / Spinner ───────────────────────────────────────────────────── */
.loading-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem;
    color: var(--text-secondary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}


/* ─── Empty State ─────────────────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--gray-300);
}

.empty-state h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.empty-state p {
    margin-bottom: 1.5rem;
}


/* ─── Page Action Bar ─────────────────────────────────────────────────────── */
.page-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-actions-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.page-actions-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group select {
    padding: 0.5rem 0.75rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius-sm);
    font-size: 0.85rem;
    background: white;
    color: var(--text-primary);
    cursor: pointer;
}


/* ─── Kanban Board ────────────────────────────────────────────────────────── */
.kanban-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.kanban-column {
    background: var(--gray-50);
    border-radius: var(--border-radius);
    padding: 1rem;
    min-height: 400px;
}

.kanban-column-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid;
}

.kanban-column-header h4 {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kanban-column-header .count {
    background: var(--gray-200);
    padding: 0.15rem 0.5rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
}

.kanban-column.todo .kanban-column-header { border-color: var(--gray-400); }
.kanban-column.in-progress .kanban-column-header { border-color: var(--info); }
.kanban-column.review .kanban-column-header { border-color: var(--warning); }
.kanban-column.done .kanban-column-header { border-color: var(--success); }

.kanban-card {
    background: white;
    border-radius: var(--border-radius-sm);
    padding: 0.85rem;
    margin-bottom: 0.5rem;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
}

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

.kanban-card-title {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.kanban-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.kanban-card-assignee {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.avatar-tiny {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
}


/* ─── Project Cards ───────────────────────────────────────────────────────── */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}

.project-card {
    background: white;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}

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

.project-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.project-card-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

.project-card-desc {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-card-stats {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.project-stat {
    text-align: center;
}

.project-stat-value {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-primary);
}

.project-stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.project-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.75rem;
    border-top: 1px solid var(--gray-100);
}

.project-members-avatars {
    display: flex;
}

.project-members-avatars .avatar-tiny {
    margin-left: -6px;
    border: 2px solid white;
}

.project-members-avatars .avatar-tiny:first-child {
    margin-left: 0;
}

.project-dates {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.progress-bar-container {
    width: 100%;
    height: 6px;
    background: var(--gray-100);
    border-radius: 50px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 50px;
    background: linear-gradient(90deg, var(--success), var(--accent));
    transition: width 0.5s ease;
}


/* ─── Task Detail Sidebar ─────────────────────────────────────────────────── */
.task-detail-panel {
    background: white;
}

.task-detail-section {
    margin-bottom: 1.25rem;
}

.task-detail-section label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 0.3rem;
}

.task-detail-section p,
.task-detail-section span {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.comment-list {
    list-style: none;
}

.comment-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--gray-100);
}

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

.comment-content {
    flex: 1;
}

.comment-author {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.comment-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: 0.5rem;
}

.comment-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.comment-input {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.comment-input input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius-sm);
    font-size: 0.85rem;
}

.comment-input input:focus {
    outline: none;
    border-color: var(--primary);
}


/* ─── Activity Feed ───────────────────────────────────────────────────────── */
.activity-list {
    list-style: none;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.6rem 0;
    font-size: 0.85rem;
}

.activity-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    flex-shrink: 0;
    background: var(--gray-100);
    color: var(--gray-600);
}

.activity-item.created .activity-icon { background: var(--success-light); color: var(--success); }
.activity-item.updated .activity-icon { background: var(--info-light); color: var(--info); }
.activity-item.status_changed .activity-icon { background: var(--warning-light); color: var(--warning); }

.activity-text {
    flex: 1;
}

.activity-text strong {
    color: var(--text-primary);
}

.activity-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}


/* ─── Settings ────────────────────────────────────────────────────────────── */
.settings-section {
    margin-bottom: 2rem;
}

.settings-section h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--gray-100);
}


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

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

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

    .login-branding {
        display: none;
    }
}

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

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

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

    .mobile-menu-btn {
        display: block;
    }

    .search-box {
        display: none;
    }

    .kanban-board {
        grid-template-columns: 1fr;
    }

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

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

    .page-actions {
        flex-direction: column;
        align-items: flex-start;
    }

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


/* ─── Utility Classes ─────────────────────────────────────────────────────── */
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger { color: var(--danger) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.d-flex { display: flex; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.w-100 { width: 100%; }
.cursor-pointer { cursor: pointer; }
