/* ====== Global ====== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

/* default body untuk dashboard, dll */
body {
    background: #f3f4f6;
    color: #111827;
}

/* khusus halaman login */
.login-page {
    min-height: 100vh;
    background: #f5f5ff;
    display: flex;
    align-items: center;
    justify-content: center;
}


/* ====== Login Card ====== */
.login-wrapper {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 15px 45px rgba(15, 23, 42, 0.12);
    padding: 32px 30px 28px 30px;
}

.login-brand {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
}

.login-logo {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 20px;
    margin-right: 10px;
}

.login-brand span {
    font-weight: 700;
    font-size: 18px;
    color: #4b5563;
}

/* Title & subtitle */
.login-title {
    font-size: 22px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 6px;
}

.login-subtitle {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 24px;
}

/* Form */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    font-size: 13px;
    font-weight: 500;
    color: #4b5563;
    margin-bottom: 6px;
    display: block;
}

.form-input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #d1d5db;
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.15);
}

/* Button */
.btn-primary {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: none;
    background: #6366f1;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    margin-top: 6px;
    transition: background 0.15s ease, transform 0.05s ease;
}

.btn-primary:hover {
    background: #4f46e5;
}

.btn-primary:active {
    transform: translateY(1px);
}

/* Error message */
.login-error {
    color: #b91c1c;
    font-size: 13px;
    margin-bottom: 12px;
}

/* ====== Admin Layout ====== */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
    width: 230px;
    background: #111827;
    color: #e5e7eb;
    padding: 18px 14px;
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
}

.sidebar-logo {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 18px;
    color: #fff;
    margin-right: 10px;
}

.brand-name {
    font-size: 16px;
    font-weight: 700;
}

.brand-sub {
    font-size: 11px;
    color: #9ca3af;
}

.sidebar-menu {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.menu-item {
    display: block;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 13px;
    color: #d1d5db;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.menu-item:hover {
    background: #1f2937;
    color: #ffffff;
}

.menu-item.active {
    background: #4f46e5;
    color: #ffffff;
}

/* Main area */
.admin-main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Topbar */
.admin-topbar {
    height: 56px;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.topbar-title {
    font-weight: 600;
    font-size: 15px;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
}

.logout-link {
    color: #ef4444;
    text-decoration: none;
}

/* Content */
.admin-content {
    padding: 22px 24px;
}

.card {
    background: #ffffff;
    border-radius: 14px;
    padding: 20px 18px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

/* ====== Table & utilities ====== */

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
}

.btn-sm {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 999px;
    border: none;
    background: #6366f1;
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
}

.btn-sm:hover {
    background: #4f46e5;
}

/* table */

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.table th,
.table td {
    padding: 8px 10px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
}

.table th {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #6b7280;
    background: #f9fafb;
}

.table tbody tr:hover {
    background: #f9fafb;
}

/* Label kecil di sidebar (MASTER, TICKET, dll) */
.menu-label {
    font-size: 11px;
    text-transform: uppercase;
    color: #6b7280;
    margin: 14px 6px 4px;
    letter-spacing: .08em;
}

/* Sub-menu di bawah label (misal: Hadiah, Hadiah Auto) */
.menu-sub-item {
    display: block;
    padding: 7px 10px 7px 20px;
    border-radius: 8px;
    font-size: 13px;
    color: #d1d5db;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.menu-sub-item:hover {
    background: #1f2937;
    color: #ffffff;
}

.menu-sub-item.active {
    background: #4f46e5;
    color: #ffffff;
}

/* ====== Action menu (tiga titik) ====== */

.action-menu {
    position: relative;
    display: inline-block;
}

.action-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    color: #6b7280;
    padding: 4px 8px;
    border-radius: 999px;
}

.action-btn:hover {
    background: #e5e7eb;
    color: #111827;
}

.action-menu-panel {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 4px;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.16);
    padding: 6px 0;
    min-width: 120px;
    display: none;
    z-index: 20;
}

.action-menu.open .action-menu-panel {
    display: block;
}

.action-menu-link {
    display: block;
    padding: 6px 12px;
    font-size: 13px;
    color: #374151;
    text-decoration: none;
}

.action-menu-link:hover {
    background: #f3f4f6;
}

.action-menu-link.delete {
    color: #b91c1c;
}

/* === Override tombol di header kartu (New, Back, dll) === */
.card-header .btn-primary,
.card-header .btn-secondary {
    width: auto;              /* jangan full width */
    min-width: 90px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 20px;
    border-radius: 6px;
}

/* === Layout khusus untuk form New Ticket === */
.ticket-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-column-gap: 24px;
}

.ticket-form-grid .form-group {
    margin-bottom: 16px;
}

/* baris tombol di bawah form */
.ticket-form-actions {
    margin-top: 24px;
    display: flex;
    gap: 12px;
}

/* input + tombol di satu baris (ticket code + generate) */
.input-with-button {
    display: flex;
    gap: 8px;
}

.input-with-button input {
    flex: 1;
}

/* tombol kecil samping input */
.btn-inline {
    width: auto;
    white-space: nowrap;
}

.action-menu {
    position: relative;
    display: inline-block;
}

.action-menu-toggle {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 4px 8px;
}

.action-menu-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    min-width: 120px;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
    border-radius: 8px;
    padding: 6px 0;
    display: none;
    z-index: 20;
}

.action-menu-dropdown a {
    display: block;
    padding: 6px 12px;
    font-size: 13px;
    color: #111827;
    text-decoration: none;
}

.action-menu-dropdown a:hover {
    background: #f3f4ff;
    color: #4f46e5;
}

.action-menu-dropdown.show {
    display: block;
}
