/**
 * Admin Panel Styles
 * Antigravity Telecom
 */

:root {
    --admin-primary: #1e3a5f;
    --admin-accent: #2980b9;
    --admin-sidebar: #1a2f4a;
    --admin-bg: #f4f6f9;
    --admin-card: #ffffff;
    --admin-text: #333333;
    --admin-muted: #6c757d;
    --admin-border: #e9ecef;
    --admin-success: #27ae60;
    --admin-warning: #f39c12;
    --admin-danger: #e74c3c;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--admin-bg);
    color: var(--admin-text);
    line-height: 1.6;
}

/* Login Page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--admin-primary) 0%, var(--admin-accent) 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 1rem;
}

.login-box {
    background: #fff;
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo .logo-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--admin-primary), var(--admin-accent));
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.login-logo h1 {
    color: var(--admin-primary);
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
}

.login-logo p {
    color: var(--admin-muted);
}

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--admin-border);
}

.login-footer a {
    color: var(--admin-muted);
    text-decoration: none;
}

.login-footer a:hover {
    color: var(--admin-accent);
}

/* Admin Layout */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
    width: 250px;
    background: var(--admin-sidebar);
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 1000;
}

.sidebar-header {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header .logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--admin-accent), #3498db);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.sidebar-header .logo-text {
    font-weight: 700;
    font-size: 1.25rem;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.3s;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.sidebar-nav a.active {
    border-left: 3px solid var(--admin-accent);
}

.sidebar-nav a i {
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-footer a {
    display: block;
    padding: 0.5rem 0;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    font-size: 0.875rem;
}

.sidebar-footer a:hover {
    color: #fff;
}

/* Main Content */
.admin-main {
    flex: 1;
    margin-left: 250px;
}

.admin-header {
    background: #fff;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.admin-header h1 {
    font-size: 1.5rem;
    color: var(--admin-primary);
}

.admin-content {
    padding: 2rem;
}

/* Dashboard Stats */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: relative;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
}

.stat-info h3 {
    font-size: 1.75rem;
    color: var(--admin-primary);
}

.stat-info p {
    color: var(--admin-muted);
    font-size: 0.875rem;
}

.stat-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--admin-success);
    color: #fff;
    padding: 0.25rem 0.5rem;
    border-radius: 20px;
    font-size: 0.75rem;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

/* Cards */
.dashboard-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--admin-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    font-size: 1rem;
    color: var(--admin-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-body {
    padding: 1.5rem;
}

/* Data Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--admin-border);
}

.data-table th {
    font-weight: 600;
    color: var(--admin-muted);
    font-size: 0.875rem;
    text-transform: uppercase;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

.data-table.full-width {
    width: 100%;
}

/* Status Badges */
.status-open,
.status-new {
    color: var(--admin-success);
    font-weight: 500;
}

.status-in_progress,
.status-contacted {
    color: var(--admin-warning);
    font-weight: 500;
}

.status-resolved,
.status-converted {
    color: var(--admin-accent);
    font-weight: 500;
}

.status-closed {
    color: var(--admin-muted);
    font-weight: 500;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: #e9ecef;
    border-radius: 4px;
    font-size: 0.75rem;
    text-transform: uppercase;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--admin-text);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--admin-accent);
    box-shadow: 0 0 0 3px rgba(41, 128, 185, 0.1);
}

.form-control-sm {
    padding: 0.375rem 0.5rem;
    font-size: 0.875rem;
    border: 1px solid var(--admin-border);
    border-radius: 4px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.input-icon {
    position: relative;
}

.input-icon i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--admin-muted);
}

.input-icon .form-control {
    padding-left: 2.75rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--admin-primary), var(--admin-accent));
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(30, 58, 95, 0.3);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

.btn-block {
    width: 100%;
}

.btn-danger {
    background: var(--admin-danger);
    color: #fff;
}

.filter-group .btn {
    background: #e9ecef;
    color: var(--admin-text);
}

.filter-group .btn.active {
    background: var(--admin-primary);
    color: #fff;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-error {
    background: #fdf2f2;
    color: var(--admin-danger);
    border: 1px solid #fecaca;
}

.alert-success {
    background: #f0fdf4;
    color: var(--admin-success);
    border: 1px solid #bbf7d0;
}

/* Page Actions */
.page-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.filter-group {
    display: flex;
    gap: 0.5rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--admin-muted);
}

/* Grid */
.grid-2 {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 1.5rem;
}

/* Inline Form */
.inline-form {
    display: inline;
}

/* Code */
code {
    background: #f4f6f9;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 1200px) {
    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .admin-sidebar {
        width: 70px;
    }

    .sidebar-header .logo-text,
    .sidebar-nav a span {
        display: none;
    }

    .admin-main {
        margin-left: 70px;
    }

    .dashboard-grid,
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .dashboard-stats {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}