@import url('cairo.css');

:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary: #64748b;
    --success: #10b981;
    --success-hover: #059669;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --bg-color: #f1f5f9;
    --card-bg: rgba(255, 255, 255, 0.85);
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', sans-serif;
    background-color: var(--bg-color);
    background-image: linear-gradient(135deg, #e2e8f0 0%, #f8fafc 100%);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navbar */
.navbar {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

nav ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
}

nav a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    transition: all 0.3s ease;
}

nav a:hover,
nav a.active {
    background-color: var(--primary);
    color: white;
}

/* Layout */
.content {
    padding: 2rem 0;
}

.page-title {
    font-size: 2rem;
    color: var(--text-main);
    margin-bottom: 1.5rem;
    border-bottom: 3px solid var(--primary);
    display: inline-block;
    padding-bottom: 0.5rem;
}

/* Card */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}

/* Form Styles */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.field-group.full-width {
    grid-column: 1 / -1;
}

label {
    font-weight: 600;
    font-size: 0.95rem;
}

.text-danger {
    color: var(--danger);
}

.optional {
    color: var(--text-muted);
    font-size: 0.8rem;
}

input,
select {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s;
    background: white;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

input[readonly] {
    background-color: #f8fafc;
    color: var(--text-muted);
    cursor: not-allowed;
}

/* Buttons */
.buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-family: inherit;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    background: #e2e8f0;
    color: var(--text-main);
}

.btn:hover {
    background: #cbd5e1;
    transform: translateY(-2px);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: var(--success-hover);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: var(--danger-hover);
}

.btn-secondary {
    background: var(--secondary);
    color: white;
}

.btn-secondary:hover {
    background: #475569;
}

/* Table Styles */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    text-align: right;
}

th,
td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

th {
    background-color: #f8fafc;
    font-weight: 600;
    color: var(--text-muted);
}

tr:hover {
    background-color: #f1f5f9;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-draft {
    background: #fef3c7;
    color: #d97706;
}

.badge-completed {
    background: #d1fae5;
    color: #059669;
}

.badge-canceled {
    background: #fee2e2;
    color: #dc2626;
}

.filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filters input {
    flex: 1;
    min-width: 200px;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: var(--radius);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-overlay.active {
    display: flex;
}

/* Print Styles */
@media print {
    body * {
        visibility: hidden;
    }

    .print-only,
    .print-only * {
        visibility: visible;
    }

    .print-only {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }

    .print-ticket {
        width: 100%;
        max-width: 297mm;
        /* A4 Landscape Width */
        padding: 20mm;
        margin: 0 auto;
        border: 2px solid #000;
        font-family: 'Cairo', sans-serif;
    }

    .print-header {
        text-align: center;
        border-bottom: 2px solid #000;
        margin-bottom: 20px;
        padding-bottom: 10px;
    }

    .print-body {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
        font-size: 1.2rem;
    }

    .print-footer {
        margin-top: 30px;
        text-align: center;
        border-top: 1px solid #000;
        padding-top: 10px;
        font-weight: bold;
    }

    .print-item {
        margin-bottom: 10px;
    }
}