/* TicketDesk - Freshdesk-inspired Theme */

:root {
    --primary-color: #2c5cc5;
    --primary-hover: #264db3;
    --success-color: #2ecc71;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --info-color: #3498db;
    --sidebar-bg: #1b2838;
    --sidebar-hover: #263849;
    --sidebar-active: #2c5cc5;
    --header-height: 56px;
    --sidebar-width: 240px;
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --text-muted: #95a5a6;
    --border-color: #e8eaed;
    --bg-light: #f5f7f9;
    --card-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 14px;
    color: var(--text-primary);
    background-color: var(--bg-light);
    line-height: 1.5;
}

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

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-header .logo-icon {
    width: 36px;
    height: 36px;
    background: var(--primary-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

.sidebar-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: white;
    margin: 0;
}

.sidebar-header small {
    display: block;
    color: var(--text-muted);
    font-size: 11px;
    margin-top: 2px;
}

.sidebar-nav {
    padding: 12px 0;
}

.nav-section {
    margin-bottom: 8px;
}

.nav-section-title {
    padding: 8px 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7b8a;
}

.nav-item {
    margin: 1px 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    color: #a8b9c7;
    text-decoration: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s ease;
}

.nav-link:hover {
    background: var(--sidebar-hover);
    color: white;
}

.nav-link.active {
    background: var(--sidebar-active);
    color: white;
}

.nav-link i {
    width: 20px;
    margin-right: 10px;
    font-size: 16px;
    text-align: center;
}

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

/* Header */
.main-header {
    height: var(--header-height);
    background: white;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px;
}

.page-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

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

.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 6px;
    transition: background 0.15s;
}

.user-menu:hover {
    background: var(--bg-light);
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 12px;
}

.user-info {
    text-align: right;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.user-role {
    font-size: 11px;
    color: var(--text-muted);
}

/* Content */
.content-wrapper {
    padding: 24px;
    flex: 1;
}

/* Cards */
.card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--card-shadow);
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    background: white;
    border-radius: 8px 8px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header i {
    color: var(--text-muted);
    margin-right: 8px;
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-light);
    border-radius: 0 0 8px 8px;
}

/* Stat Cards - Freshdesk Style */
.stat-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--card-shadow);
    transition: box-shadow 0.2s, transform 0.2s;
}

.stat-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: white;
    margin-bottom: 16px;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-card .stat-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Tables */
.table {
    margin-bottom: 0;
    font-size: 13px;
}

.table thead th {
    background: var(--bg-light);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 16px;
}

.table tbody td {
    padding: 14px 16px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

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

.table-hover tbody tr:hover {
    background-color: #f8f9fa;
}

/* Ticket Number Link */
.ticket-number {
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-weight: 600;
    font-size: 13px;
    color: var(--primary-color);
    text-decoration: none;
}

.ticket-number:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Badges */
.badge {
    font-weight: 500;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Buttons */
.btn {
    font-size: 13px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

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

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

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

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

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

/* Forms */
.form-control, .form-select {
    font-size: 13px;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(44, 92, 197, 0.1);
}

.form-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Login Page */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1b2838 0%, #2c3e50 100%);
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo .logo-icon {
    width: 56px;
    height: 56px;
    background: var(--primary-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 28px;
    color: white;
}

.login-logo h2 {
    color: var(--text-primary);
    font-size: 24px;
    font-weight: 700;
    margin: 0;
}

.login-logo p {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 8px;
}

/* Modals */
.modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 20px 24px;
}

.modal-title {
    font-size: 16px;
    font-weight: 600;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 16px 24px;
    background: var(--bg-light);
    border-radius: 0 0 12px 12px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 48px 20px;
}

.empty-state i {
    font-size: 48px;
    color: #ddd;
    margin-bottom: 16px;
}

.empty-state h5 {
    font-size: 16px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 8px;
}

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

/* Activity Feed */
.activity-item {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.activity-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 12px;
    flex-shrink: 0;
}

/* Comments */
.comment-item {
    padding: 16px;
    border-radius: 8px;
    background: var(--bg-light);
    margin-bottom: 12px;
    border-left: 3px solid var(--primary-color);
}

.comment-item.internal {
    background: #fffbeb;
    border-left-color: var(--warning-color);
}

/* Alerts */
.alert {
    border: none;
    border-radius: 8px;
    font-size: 13px;
    padding: 14px 18px;
}

/* Pagination */
.pagination {
    gap: 4px;
}

.page-link {
    border-radius: 6px;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 13px;
    padding: 8px 14px;
}

.page-link:hover {
    background: var(--bg-light);
}

.page-item.active .page-link {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

/* Dropdown */
.dropdown-menu {
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    border-radius: 8px;
    padding: 8px;
}

.dropdown-item {
    padding: 8px 14px;
    font-size: 13px;
    border-radius: 4px;
}

.dropdown-item:hover {
    background: var(--bg-light);
}

/* Filters Bar */
.filters-bar {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Responsive */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .mobile-toggle {
        display: block;
    }
}

@media (max-width: 768px) {
    .content-wrapper {
        padding: 16px;
    }
    
    .stat-card {
        margin-bottom: 12px;
    }
    
    .stat-card .stat-value {
        font-size: 24px;
    }
}

/* Entity Cards */
.entity-card {
    border-left: 4px solid var(--primary-color);
}

.entity-card .stats-row {
    display: flex;
    gap: 24px;
    text-align: center;
}

.entity-card .stats-row .stat {
    flex: 1;
}

.entity-card .stats-row .number {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
}

.entity-card .stats-row .label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* Tabs */
.nav-tabs {
    border-bottom: 2px solid var(--border-color);
}

.nav-tabs .nav-link {
    border: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 13px;
    padding: 12px 16px;
    margin-bottom: -2px;
}

.nav-tabs .nav-link:hover {
    color: var(--primary-color);
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    background: transparent;
    border-bottom: 2px solid var(--primary-color);
}

/* Status/Priority list in sidebar */
.status-list .status-item,
.priority-list .priority-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.status-list .status-item .name,
.priority-list .priority-item .name {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.status-list .status-item .count,
.priority-list .priority-item .count {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
}

.color-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}