/* Indutec Systems Design System */
:root {
    --primary-hue: 250;
    --primary-sat: 70%;
    --primary-light: 60%;

    /* --- LIGHT THEME (Default) --- */
    --bg-dark: #f0f2f5;
    --bg-card: #ffffff;
    --bg-card-hover: #f1f5f9;
    --bg-hover: #f1f5f9;
    --bg-surface-hover: #e2e8f0;
    --bg-muted: #e2e8f0;

    /* Sidebar - Dark purple theme */
    --sidebar-bg: linear-gradient(180deg, #2d2a5e 0%, #1e1b4b 100%);
    --sidebar-text: rgba(255, 255, 255, 0.7);
    --sidebar-text-active: #ffffff;
    --sidebar-hover: rgba(255, 255, 255, 0.1);
    --sidebar-active: rgba(99, 102, 241, 0.3);

    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-light: #334155;
    --text-secondary: #475569;

    --border-color: #e2e8f0;
    --glass-border: 1px solid #e2e8f0;
    --glass-bg: rgba(255, 255, 255, 0.9);
    --backdrop-blur: 12px;

    --accent: #6366f1;
    --accent-glow: rgba(99, 102, 241, 0.2);

    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;

    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -2px rgb(0 0 0 / 0.1);

    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
}

/* --- DARK THEME OVERRIDES --- */
[data-theme="dark"] {
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-card-hover: #334155;
    --bg-hover: rgba(255, 255, 255, 0.05);
    --bg-surface-hover: rgba(255, 255, 255, 0.02);
    --bg-muted: rgba(255, 255, 255, 0.1);

    --sidebar-bg: linear-gradient(180deg, #1e1b4b 0%, #0f0d2e 100%);

    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-light: #e2e8f0;
    --text-secondary: #cbd5e1;

    --border-color: rgba(255, 255, 255, 0.1);
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);
    --glass-bg: rgba(30, 41, 59, 0.8);

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.5);

    --accent-glow: rgba(99, 102, 241, 0.4);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-main);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Theme transition for all elements */
*,
*::before,
*::after {
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.5rem;
}

h3 {
    font-size: 1.25rem;
}

/* Layout */
.app-container {
    display: grid;
    grid-template-columns: 220px 1fr;
    height: 100vh;
    overflow: hidden;
    transition: grid-template-columns 0.3s ease;
}

.app-container.collapsed {
    grid-template-columns: 70px 1fr;
}

/* Sidebar - Dark Purple Theme */
.sidebar {
    background: var(--sidebar-bg);
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
    border-right: none;
}

.brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    height: 40px;
}

.brand-logo {
    height: 28px;
    width: auto;
    max-width: 130px;
    object-fit: contain;
    transition: all 0.3s;
    filter: brightness(0) invert(1);
}

.sidebar-toggle {
    background: transparent;
    border: none;
    color: var(--sidebar-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

.sidebar-toggle:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-text-active);
}

.app-container.collapsed .brand-logo {
    display: none;
}

.app-container.collapsed .sidebar-toggle {
    margin: 0 auto;
    transform: rotate(180deg);
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.9rem;
    white-space: nowrap;
    height: 42px;
}

.app-container.collapsed .nav-item a {
    justify-content: center;
    padding: 0.65rem;
}

.nav-item a ion-icon {
    font-size: 1.2rem;
    min-width: 1.2rem;
}

/* Hide text and extra elements in collapsed mode */
.app-container.collapsed .nav-item a span:not(.badge),
.app-container.collapsed .nav-item a .badge,
.app-container.collapsed .nav-item a .toggle-switch {
    display: none;
}

.nav-item a:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-text-active);
}

.nav-item a.active {
    background: var(--sidebar-active);
    color: var(--sidebar-text-active);
}

/* Badge in sidebar */
.nav-item .badge {
    margin-left: auto;
    background: #10b981;
    color: white;
    padding: 2px 8px;
    font-size: 0.7rem;
    border-radius: 10px;
}

/* Main Content */
.main-content {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    background: var(--bg-dark);
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.header-title h2 {
    font-size: 1.5rem;
    margin-bottom: 0.15rem;
}

.header-title p {
    font-size: 0.85rem;
    margin: 0;
}

.header-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.content-wrapper {
    flex: 1;
    overflow: auto;
    display: flex;
    flex-direction: column;
}

/* Components */
.card {
    background: var(--glass-bg);
    border: var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    backdrop-filter: blur(var(--backdrop-blur));
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--accent);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem;
    gap: 0.4rem;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 4px 14px 0 rgba(99, 102, 241, 0.39);
}

.btn-primary:hover {
    background: #5558e3;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.3);
}

.btn-secondary {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}

.btn-secondary:hover {
    background: var(--bg-hover);
    color: var(--accent);
    border-color: var(--accent);
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-new {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.badge-pending {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.badge-urgent {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

/* Ticket List */
.ticket-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ticket-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 1.5rem;
    cursor: pointer;
}

.ticket-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
}

.ticket-info h4 {
    margin-bottom: 0.25rem;
}

.ticket-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.input-field {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-family: inherit;
    transition: all 0.2s ease;
}

.input-field:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--bg-card);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Form select styling */
.form-input {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-main);
    font-size: 0.85rem;
    cursor: pointer;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.3s ease-out forwards;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}
