/* assets/css/global.css - Sophisticated Design System */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Color Palette - Sophisticated & Professional */
    --primary-50: #e0e7ff;
    --primary-100: #c7d2fe;
    --primary-500: #6366f1;
    --primary-600: #4f46e5;
    --primary-700: #4338ca;

    --secondary-50: #f8fafc;
    --secondary-500: #64748b;
    --secondary-900: #0f172a;

    --success-500: #10b981;
    --success-600: #059669;

    --warning-500: #f59e0b;
    --warning-600: #d97706;

    --danger-500: #ef4444;
    --danger-600: #dc2626;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-warning: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --gradient-danger: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    --gradient-surface: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);

    /* Backgrounds */
    --bg-body: #f1f5f9;
    --bg-card: #ffffff;
    --bg-sidebar: #ffffff;

    /* Borders */
    --border-color: #e2e8f0;
    --border-radius-sm: 4px;
    --border-radius-md: 6px;
    --border-radius-lg: 8px;
    --border-radius-xl: 12px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-glow: 0 0 20px rgba(79, 70, 229, 0.15);

    /* Typography */
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;

    /* Layout */
    --header-height: 70px;
    --sidebar-width: 260px;
}

/* Global Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background-color: #ffffff;
    color: var(--secondary-900);
    line-height: 1.5;
    min-height: 100vh;
    padding-top: var(--header-height);
}

a {
    color: var(--primary-600);
    text-decoration: none;
    transition: all 0.2s ease;
}

a:hover {
    color: var(--primary-700);
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--secondary-900);
    font-weight: 700;
    letter-spacing: -0.025em;
    margin-bottom: 0.5em;
}

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.5rem;
}

h3 {
    font-size: 1.25rem;
}

/* Buttons - Global Component */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
}

.btn:active {
    transform: translateY(1px);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

/* Button Variants */
.btn-primary {
    background: var(--primary-600);
    color: white;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-primary:hover {
    background: var(--primary-700);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-secondary {
    background: white;
    border: 1px solid #e2e8f0;
    color: var(--secondary-500);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover {
    background: #f8fafc;
    color: var(--secondary-900);
    border-color: #cbd5e1;
}

.btn-success {
    background: var(--success-600);
    color: white;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-success:hover {
    background: #047857;
}

.btn-danger {
    background: var(--danger-600);
    color: white;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-warning {
    background: var(--warning-600);
    color: white;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-warning:hover {
    background: #b45309;
}

.btn-icon-only {
    padding: 0.75rem;
    width: 2.5rem;
    height: 2.5rem;
}

/* Cards - Global Component */
.card {
    background: var(--bg-card);
    border-radius: var(--border-radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: var(--shadow-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.card-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2,
.card-header h3 {
    margin-bottom: 0;
}

/* Inputs - Global Design */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
select,
textarea,
.form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 0.9375rem;
    font-family: var(--font-sans);
    color: var(--secondary-900);
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

input:focus,
select:focus,
textarea:focus,
.form-control:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--secondary-500);
}

.form-group {
    margin-bottom: 1.5rem;
}

/* Header Styles (Integrated from modern_header.css) */
.header {
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    height: var(--header-height);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.header-brand a {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-logo {
    height: 40px;
    width: auto;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links a {
    padding: 0.625rem 1rem;
    border-radius: var(--border-radius-md);
    color: var(--secondary-500);
    font-weight: 500;
    font-size: 0.9375rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links a:hover {
    background-color: var(--secondary-50);
    color: var(--primary-600);
}

.nav-links a.active {
    background-color: var(--primary-50);
    color: var(--primary-700);
}

.nav-badge {
    background: var(--danger-500);
    color: white;
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    font-weight: 700;
}

/* Sidebar Layout */
.layout-container {
    display: flex;
    min-height: calc(100vh - var(--header-height));
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    padding: 2rem 1rem;
    position: fixed;
    bottom: 0;
    top: var(--header-height);
    overflow-y: auto;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    /* If sidebar is fixed */
    padding: 2.5rem;
}

.main-content.no-sidebar {
    margin-left: 0;
    max-width: 1200px;
    margin: 0 auto;
}

/* Thin Scrollbar for Sidebars */
.sidebar::-webkit-scrollbar,
.task-sidebar::-webkit-scrollbar,
[class*="sidebar"]::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track,
.task-sidebar::-webkit-scrollbar-track,
[class*="sidebar"]::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb,
.task-sidebar::-webkit-scrollbar-thumb,
[class*="sidebar"]::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb:hover,
.task-sidebar::-webkit-scrollbar-thumb:hover,
[class*="sidebar"]::-webkit-scrollbar-thumb:hover {
    background-color: #94a3b8;
}

/* Sidebar Items */
.sidebar-item {
    margin-bottom: 0.25rem;
}

.sidebar-item a {
    display: flex;
    align-items: center;
    padding: 0.625rem 1rem;
    border-radius: var(--border-radius-md);
    color: var(--secondary-500);
    font-weight: 500;
    justify-content: space-between;
}

.sidebar-item a:hover {
    background-color: var(--secondary-50);
    color: var(--primary-600);
}

.sidebar-item.active a {
    background-color: var(--primary-50);
    color: var(--primary-700);
}

.sidebar-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--secondary-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 1.5rem 0 0.5rem 1rem;
}

.sidebar-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 1rem 1rem;
}

.sidebar-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-badge {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--secondary-500);
    background: var(--secondary-50);
    padding: 2px 8px;
    border-radius: 12px;
}

.sidebar-item.active .sidebar-badge {
    background: white;
    color: var(--primary-700);
}

/* Tables */
.table-container {
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin-top: 1.5rem;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background-color: var(--secondary-50);
    color: var(--secondary-500);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.875rem 1.25rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

td {
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--secondary-900);
    font-size: 0.9375rem;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background-color: #f1f5f9;
}

.task-row {
    cursor: pointer;
    transition: background-color 0.2s ease;
}


/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
}

.badge-primary {
    background: var(--primary-50);
    color: var(--primary-700);
}

.badge-success {
    background: #dcfce7;
    color: #15803d;
}

.badge-warning {
    background: #fef3c7;
    color: #b45309;
}

.badge-danger {
    background: #fee2e2;
    color: #b91c1c;
}

.badge-secondary {
    background: var(--secondary-50);
    color: var(--secondary-500);
}

/* Utilities */
.text-center {
    text-align: center;
}

.d-flex {
    display: flex;
}

.align-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-2 {
    gap: 0.5rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}


/* User Profile Nav */
.user-profile-nav {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: 20px;
    padding-left: 20px;
    border-left: 1px solid rgba(0, 0, 0, 0.1);
    white-space: nowrap;
}

.user-name {
    color: var(--secondary-500);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logout-btn {
    color: var(--danger-500);
    background: rgba(239, 68, 68, 0.1);
    padding: 8px 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.logout-btn:hover {
    background: var(--danger-500);
    color: white;
}

/* Page Header Utility */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}


/* Legacy Support for Status & Priority */
.priority {
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: white;
    display: inline-block;
    white-space: nowrap;
}

.priority-high {
    background: var(--gradient-danger);
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

.priority-medium {
    background: var(--gradient-warning);
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
}

.priority-low {
    background: var(--gradient-success);
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.status {
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    display: inline-block;
    white-space: nowrap;
}

.status-todo,
.status-new {
    background: var(--primary-100);
    color: var(--primary-700);
}

.status-in_progress,
.status-in-progress {
    background: var(--warning-500);
    color: white;
}

.status-submitted_for_review,
.status-review {
    background: var(--primary-500);
    color: white;
}

.status-needs_revision,
.status-revision {
    background: var(--danger-500);
    color: white;
}

.status-completed {
    background: var(--success-500);
    color: white;
}

/* Action Buttons specific to Tasks */
.action-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-right: 4px;
}

.action-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.action-btn i {
    font-size: 0.875rem;
}

.action-btn-edit {
    background-color: var(--warning-500);
}

.action-btn-start {
    background-color: var(--success-500);
}

.action-btn-submit {
    background-color: var(--primary-500);
}

.action-btn-resume {
    background-color: var(--warning-600);
}

.action-btn-review {
    background-color: var(--primary-600);
}

.action-btn-view {
    background-color: var(--secondary-500);
}

.action-btn-locked {
    background: var(--secondary-50);
    color: var(--secondary-500);
    cursor: not-allowed;
}

/* Stats Summary using Grid */
.stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-todo .stat-icon {
    background: var(--primary-50);
    color: var(--primary-600);
}

.stat-progress .stat-icon {
    background: #fef3c7;
    color: var(--warning-600);
}

.stat-review .stat-icon {
    background: #e0e7ff;
    color: var(--primary-600);
}

.stat-revision .stat-icon {
    background: #fee2e2;
    color: var(--danger-600);
}

.stat-completed .stat-icon {
    background: #dcfce7;
    color: var(--success-600);
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--secondary-900);
    line-height: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--secondary-500);
    font-weight: 500;
    margin-top: 0.25rem;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--bg-card);
    margin: 2rem auto;
    padding: 2rem;
    width: 95%;
    max-width: 700px;
    border-radius: var(--radius-lg);
    position: relative;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border-color);
}

.modal-content .close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
}

.modal-content .close:hover {
    color: var(--text-main);
}

/* Ticket Type Badges */
.type-badge {
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    display: inline-block;
}

.type-bug {
    background: #fee2e2;
    color: #dc2626;
}

.type-feature_request {
    background: #e0e7ff;
    color: #4338ca;
}

.type-payment {
    background: #dcfce7;
    color: #15803d;
}

.type-support {
    background: #f3f4f6;
    color: #4b5563;
}

/* Legacy Action Buttons (for tickets.php) */
.action-button {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-right: 4px;
    font-size: 0.875rem;
}

.action-button:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.edit-button {
    background-color: var(--warning-500);
}

.resolve-button,
.complete-button {
    background-color: var(--success-500);
}

.delete-button {
    background-color: var(--danger-500);
}